Yes, that code snippet works for me.
Edited to be more specific.. Unless "network_id" is defined somewhere else in your code, you'll need quotation marks around the Network ID, so..
devices = dashboard.organizations.getOrganizationDevices(
organizationId=organization_id, networkIds=['network_id'])
Thanks!