def _GetDeviceEmulationMetadata(device):
  """Returns the metadata associated with a given device."""
  return {'width': device['screen']['vertical']['width'],
          'height': device['screen']['vertical']['height'],
          'deviceScaleFactor': device['screen']['device-pixel-ratio'],
          'mobile': 'mobile' in device['capabilities'],
          'userAgent': device['user-agent']}