Get inner schemas by name.

        :return: ordered dict by name.
        :rtype: OrderedDict
354360
def getschemas(cls):
        
        members = getmembers(cls, lambda member: isinstance(member, Schema))

        result = OrderedDict()

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

        return result
409043
def _schema_getter(self, db):
        """"""
        # Change DB connection if needed
        if self.database != db:
            self.change_db(db)
        schema_dict = {tbl: self.get_schema(tbl) for tbl in self.tables}

        schema_lst = []
        for table, schema in schema_dict.items():
            for col in schema:
                col.insert(0, table)
                schema_lst.append(col)
        return schema_lst
1164947
def get_view_names(self, connection, schema=None, **kw):
        
        return self._get_table_or_view_names('v', connection, schema, **kw)
921918
def query_schema(self, name, param):
        

        alias, name, need_list = self.parse_entry(name)

        if not name:
            result = self.process_multiple_query(need_list, param)
        else:
            result = self.process_single_query(name, need_list, param)
        return alias, result
179804
def get_name(self, data):
        
        if self.node.specific_attribute:
            return self.node.name
        name = data.get(self.predicate_var)
        if str(RDF.type) in [self.node.name, name]:
            return '$schema'
        if name.startswith(PRED):
            name = name[len(PRED):]
        return name
625766
def schemas(self):
        
        sql = """SELECT schema_name FROM information_schema.schemata
                 ORDER BY schema_name"""
        schemas = self.query(sql).fetchall()
        return [s[0] for s in schemas if s[0][:3] != "pg_"]
959449
def dict(self):
        
        from collections import OrderedDict
        SKIP_KEYS = ()
        return OrderedDict(
            (p.key, getattr(self, p.key)) for p in self.__mapper__.attrs if p.key not in SKIP_KEYS)
1194532
def byname(nlist):
    
    warnings.warn("The internal byname() function has been deprecated, with "
                  "no replacement.", DeprecationWarning,
                  stacklevel=_stacklevel_above_module(__name__))
    return OrderedDict([(x.name, x) for x in nlist])
489207
def get_table_names(cls, inspector, schema):
        """"""
        tables = inspector.get_table_names(schema)
        tables.extend(inspector.get_foreign_table_names(schema))
        return sorted(tables)
90975
def _get_generic_schema(self):
        
        schema = Schema(
            identifier=ID(stored=True),  # Partition versioned id
            type=ID(stored=True),
            name=NGRAM(phrase=True, stored=True, minsize=2, maxsize=8))
        return schema
214175
def _get_property_dict(schema):
    
    pdict = {}
    for k, v in schema['properties'].items():
        pdict[k] = {}
        if 'items' in v and 'properties' in v['items']:
            pdict[k] = _get_property_dict(v['items'])
    pdict[settings.LEVEL_FIELD] = {}
    return pdict
640021
def as_dict(self):
        
        odict = OrderedDict()
        for name in self._order:
            attr_value = getattr(self, name)
            if isinstance(attr_value, List):
                _list = []
                for item in attr_value:
                    _list.append((item.as_dict() if isinstance(item, Entity) else item))
                    odict[name] = _list
            elif isinstance(attr_value, Entity):
                odict[name] = attr_value.as_dict()
            else:
                odict[name] = getattr(self, name)
        return odict
749138
def _dict(self, with_name=True):
        

        d = dict([(k, getattr(self, k)) for k, _, _ in self.name_parts])

        return self.clear_dict(d)
184775
def sorted(collection):
        
        if len(collection) < 1:
            return collection

        if isinstance(collection, dict):
            return sorted(collection.items(), key=lambda x: x[0])

        if isinstance(list(collection)[0], Operation):
            key = lambda x: x.operation_id
        elif isinstance(list(collection)[0], str):
            key = lambda x: SchemaObjects.get(x).name
        else:
            raise TypeError(type(collection[0]))
        return sorted(collection, key=key)
1262216
def _infer_schema(row, names=None):
    """"""
    if isinstance(row, dict):
        items = sorted(row.items())

    elif isinstance(row, (tuple, list)):
        if hasattr(row, "__fields__"):  # Row
            items = zip(row.__fields__, tuple(row))
        elif hasattr(row, "_fields"):  # namedtuple
            items = zip(row._fields, tuple(row))
        else:
            if names is None:
                names = ['_%d' % i for i in range(1, len(row) + 1)]
            elif len(names) < len(row):
                names.extend('_%d' % i for i in range(len(names) + 1, len(row) + 1))
            items = zip(names, row)

    elif hasattr(row, "__dict__"):  # object
        items = sorted(row.__dict__.items())

    else:
        raise TypeError("Can not infer schema for type: %s" % type(row))

    fields = [StructField(k, _infer_type(v), True) for k, v in items]
    return StructType(fields)
157490
def do_get_aliases(name):
  
  metric_schemas = MetricSchemas()
  aliases = metric_schemas.get_aliases(name)
  for alias in aliases:
    do_print(alias)
1063148
def get_index_by_name(self, name):
        """"""
        for i in range(self.n_blocks):
            if self.get_block_name(i) == name:
                return i
        raise KeyError('Block name ({}) not found'.format(name))