def expand_hierarchy_metadata(metadata):
 try:
  name = metadata['name']
 except KeyError:
  raise ModelError('Hierarchy has no name')
 if (not ('levels' in metadata)):
  raise ModelError(("Hierarchy '%s' has no levels" % name))
 return metadata

def expand_hierarchy_metadata ( metadata ) : try : name = metadata [ 'name' ] except KeyError : raise ModelError ( 'Hierarchy has no name' ) if ( not ( 'levels' in metadata ) ) : raise ModelError ( ( "Hierarchy '%s' has no levels" % name ) ) return metadata
returns a hierarchy metadata as a dictionary .