def IndexToKey(index):
 props = []
 if (index.properties is not None):
  for prop in index.properties:
   if (prop.direction == 'asc'):
    direction = ASCENDING
   else:
    direction = DESCENDING
   props.append((prop.name, direction))
 return (index.kind, index.ancestor, tuple(props))

def IndexToKey ( index ) : props = [ ] if ( index . properties is not None ) : for prop in index . properties : if ( prop . direction == 'asc' ) : direction = ASCENDING else : direction = DESCENDING props . append ( ( prop . name , direction ) ) return ( index . kind , index . ancestor , tuple ( props ) )
convert index to key .