def format_as_index(indices):
 if (not indices):
  return ''
 return ('[%s]' % ']['.join((repr(index) for index in indices)))

def format_as_index ( indices ) : if ( not indices ) : return '' return ( '[%s]' % '][' . join ( ( repr ( index ) for index in indices ) ) )
construct a single string containing indexing operations for the indices .