get all the indexes

        schema -- Schema()

        return -- dict -- the indexes in {indexname: fields} format
481128
def get_indexes(self, schema, **kwargs):
        
        with self.connection(**kwargs) as connection:
            kwargs['connection'] = connection
            return self._get_indexes(schema, **kwargs)
354360
def getschemas(cls):
        
        members = getmembers(cls, lambda member: isinstance(member, Schema))

        result = OrderedDict()

        for name, member in members:
            result[name] = member

        return result
175009
def all_fields(self):
        
        fields = []
        if self.parent_type:
            fields.extend(self.parent_type.all_fields)
        fields.extend([f for f in self.fields])
        return fields
320634
def _set_index(self, schema, name, fields, **index_options):
        
        index_fields = []
        for field_name in fields:
            field = schema.fields[field_name]
            if issubclass(field.type, basestring):
                if field.options.get('ignore_case', False):
                    field_name = 'UPPER({})'.format(self._normalize_name(field_name))
            index_fields.append(field_name)

        query_str = 'CREATE {}INDEX {} ON {} USING BTREE ({})'.format(
            'UNIQUE ' if index_options.get('unique', False) else '',
            self._normalize_name("{}_{}".format(schema, name)),
            self._normalize_table_name(schema),
            ', '.join(index_fields)
        )

        return self.query(query_str, ignore_result=True, **index_options)
351040
def schema(self):
        
        attrs = self.attrs.copy()
        parts = ["CREATE", "TABLE", self.name, "(%s," % self.hash_key.schema]
        del attrs[self.hash_key.name]
        if self.range_key:
            parts.append(self.range_key.schema + ",")
            del attrs[self.range_key.name]
        if attrs:
            attr_def = ", ".join([attr.schema for attr in itervalues(attrs)])
            parts.append(attr_def + ",")

        parts.append(
            "THROUGHPUT (%d, %d))" % (self.read_throughput, self.write_throughput)
        )
        parts.extend([g.schema for g in itervalues(self.global_indexes)])
        return " ".join(parts) + ";"
1138962
def iter_schemas(self, schema: Schema) -> Iterable[Tuple[str, Any]]:
        
        if not schema:
            return

        yield self.to_tuple(schema)

        for name, field in self.iter_fields(schema):
            if isinstance(field, Nested):
                yield self.to_tuple(field.schema)
                yield from self.iter_schemas(field.schema)

            if isinstance(field, List) and isinstance(field.container, Nested):
                yield self.to_tuple(field.container.schema)
                yield from self.iter_schemas(field.container.schema)
603598
def indexes(self, recurse=True):
        
        output = self.__indexes.copy()
        if recurse and self.inherits():
            schema = orb.system.schema(self.inherits())
            if not schema:
                raise orb.errors.ModelNotFound(schema=self.inherits())
            else:
                output.update(schema.indexes(recurse=recurse))
        return output
1059714
def indexes(self) -> 'Mapping[Any, pd.Index]':
        
        if self._indexes is None:
            self._indexes = default_indexes(self._variables, self._dims)
        return Indexes(self._indexes)
377076
def get_indexes(self, default_indexes=None):
        
        doctype = self.type.get_mapping_type_name()
        indexes = (settings.ES_INDEXES.get(doctype) or
                   settings.ES_INDEXES['default'])
        if isinstance(indexes, six.string_types):
            indexes = [indexes]
        return super(S, self).get_indexes(default_indexes=indexes)
1020673
def _get_indexes(self, schema, **kwargs):
        """"""
        ret = {}
        query_str = []
        query_str.append('SELECT')
        query_str.append('  tbl.relname AS table_name, i.relname AS index_name, a.attname AS field_name,')
        query_str.append('  ix.indkey AS index_order, a.attnum AS field_num')
        query_str.append('FROM')
        query_str.append('  pg_class tbl, pg_class i, pg_index ix, pg_attribute a')
        query_str.append('WHERE')
        query_str.append('  tbl.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = tbl.oid')
        query_str.append('  AND a.attnum = ANY(ix.indkey) AND tbl.relkind = %s AND tbl.relname = %s')
        query_str.append('ORDER BY')
        query_str.append('  tbl.relname, i.relname')
        query_str = os.linesep.join(query_str)

        indexes = self.query(query_str, 'r', str(schema), **kwargs)

        # massage the data into more readable {index_name: fields} format
        for idict in indexes:
            if idict['index_name'] not in ret:
                ret[idict['index_name']] = list(map(int, idict['index_order'].split(' ')))

            i = ret[idict['index_name']].index(idict['field_num'])
            ret[idict['index_name']][i] = idict['field_name']

        return ret
1003966
def schema(self):
        
        if self.key_type is None:
            return "%s %s" % (self.name, self.data_type)
        else:
            return "%s %s %s KEY" % (self.name, self.data_type, self.key_type)
230050
def iter_schemas(schema: Schema) -> Iterable[Tuple[str, Any]]:
    
    builder = Schemas(build_parameter=build_parameter)
    return builder.iter_schemas(schema)
1089431
def get_indexes(self):
        
        ret = {}
        for index in self.iter_query_indexes():
            ret[index.name] = index
        return ret
145204
def decode_search_index(self, index):
        
        result = {}
        result['name'] = bytes_to_str(index.name)
        if index.HasField('schema'):
            result['schema'] = bytes_to_str(index.schema)
        if index.HasField('n_val'):
            result['n_val'] = index.n_val
        return result
557427
def schema(self) -> dict:
        
        if not self._merged_schema:
            log.debug("merging required dict into schema for %s", self.name)
            self._merged_schema = self._schema.copy()
            self._merged_schema.update(self._required)
        return self._merged_schema
523448
def get_schema(self, *args, **kwargs):
        

        klass = self.get_schema_class()

        # kwargs context value take precedence.
        kwargs['context'] = dict(
            self.get_schema_context(),
            **kwargs.get('context', {})
        )

        return klass(*args, strict=True, **kwargs)
864412
def get_field_list(fields, schema):
  
  # If the fields weren't supplied get them from the schema.
  if schema:
    all_fields = [f['name'] for f in schema._bq_schema if f['type'] != 'RECORD']

  if isinstance(fields, list):
    if schema:
      # validate fields exist
      for f in fields:
        if f not in all_fields:
          raise Exception('Cannot find field %s in given schema' % f)
    return fields
  if isinstance(fields, basestring) and fields != '*':
    if schema:
      # validate fields exist
      for f in fields.split(','):
        if f not in all_fields:
          raise Exception('Cannot find field %s in given schema' % f)
      return fields.split(',')
  if not schema:
    return []
  return all_fields