def host_topology_and_format_from_host(host):
 was_json = False
 try:
  host_numa_topology = host.get('numa_topology')
 except AttributeError:
  host_numa_topology = host.numa_topology
 if ((host_numa_topology is not None) and isinstance(host_numa_topology, six.string_types)):
  was_json = True
  host_numa_topology = objects.NUMATopology.obj_from_db_obj(host_numa_topology)
 return (host_numa_topology, was_json)

def host_topology_and_format_from_host ( host ) : was_json = False try : host_numa_topology = host . get ( 'numa_topology' ) except AttributeError : host_numa_topology = host . numa_topology if ( ( host_numa_topology is not None ) and isinstance ( host_numa_topology , six . string_types ) ) : was_json = True host_numa_topology = objects . NUMATopology . obj_from_db_obj ( host_numa_topology ) return ( host_numa_topology , was_json )
extract numa topology from myriad host representations .