def extract_instance_type(instance, prefix=''):
 instance_type = {}
 sys_meta = utils.metadata_to_dict(instance['system_metadata'])
 for (key, type_fn) in system_metadata_instance_type_props.items():
  type_key = ('%sinstance_type_%s' % (prefix, key))
  instance_type[key] = type_fn(sys_meta[type_key])
 return instance_type

def extract_instance_type ( instance , prefix = '' ) : instance_type = { } sys_meta = utils . metadata_to_dict ( instance [ 'system_metadata' ] ) for ( key , type_fn ) in system_metadata_instance_type_props . items ( ) : type_key = ( '%sinstance_type_%s' % ( prefix , key ) ) instance_type [ key ] = type_fn ( sys_meta [ type_key ] ) return instance_type
create an instancetype-like object from instances system_metadata information .