def from_pci_stats(pci_stats):
 pools = []
 if isinstance(pci_stats, six.string_types):
  try:
   pci_stats = jsonutils.loads(pci_stats)
  except (ValueError, TypeError):
   pci_stats = None
 if pci_stats:
  if ('nova_object.namespace' in pci_stats):
   return objects.PciDevicePoolList.obj_from_primitive(pci_stats)
  elif isinstance(pci_stats, list):
   pools = [objects.PciDevicePool.from_dict(stat) for stat in pci_stats]
  else:
   pools = [objects.PciDevicePool.from_dict(pci_stats)]
 return objects.PciDevicePoolList(objects=pools)

def from_pci_stats ( pci_stats ) : pools = [ ] if isinstance ( pci_stats , six . string_types ) : try : pci_stats = jsonutils . loads ( pci_stats ) except ( ValueError , TypeError ) : pci_stats = None if pci_stats : if ( 'nova_object.namespace' in pci_stats ) : return objects . PciDevicePoolList . obj_from_primitive ( pci_stats ) elif isinstance ( pci_stats , list ) : pools = [ objects . PciDevicePool . from_dict ( stat ) for stat in pci_stats ] else : pools = [ objects . PciDevicePool . from_dict ( pci_stats ) ] return objects . PciDevicePoolList ( objects = pools )
create and return a pcidevicepoollist from the data stored in the db .