Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def from_api_response(cls, client, api_response):
self = cls(client)
self._locationid = api_response['LocationID']
devices = api_response['Devices']
_devices = [Device.from_location_response(client, self, dev)
for dev in devices]
self._devices = {dev.deviceid: dev for dev in _devices}
return self