@classmethod
    def from_doc(cls, doc, aliases={}):
        """
        Constructs a namespace object from a namespace doc returned by the API
        site_info call.
        """
        return cls(
            doc['id'],
            doc['*'],
            canonical=doc.get('canonical'),
            aliases=set(aliases.get(doc['id'], [])),
            case=doc['case'],
            content='content' in doc
        )
dataset/ETHPy150Open mediawiki-utilities/python-mediawiki-utilities/mw/types/namespace.py/Namespace.from_doc/original