def prettify_index(index, initial_indent=3):
 indent = (' ' * initial_indent)
 output = 'kind: {}\n'.format(index.entity_type())
 if index.ancestor():
  output += '{}ancestor: yes\n'.format(indent)
 output += '{}properties:\n'.format(indent)
 for prop in index.property_list():
  output += '{}- name: {}\n'.format(indent, prop.name())
  if (prop.direction() == prop.DESCENDING):
   output += '{}direction: desc\n'.format((indent + '  '))
 return output

def prettify_index ( index , initial_indent = 3 ) : indent = ( ' ' * initial_indent ) output = 'kind: {}\n' . format ( index . entity_type ( ) ) if index . ancestor ( ) : output += '{}ancestor: yes\n' . format ( indent ) output += '{}properties:\n' . format ( indent ) for prop in index . property_list ( ) : output += '{}- name: {}\n' . format ( indent , prop . name ( ) ) if ( prop . direction ( ) == prop . DESCENDING ) : output += '{}direction: desc\n' . format ( ( indent + '  ' ) ) return output
formats an index definition as it appears in the yaml definition .