:return: Mappings of format-extension and loader class.
        :rtype: dict
508035
def _get_extension_loader_mapping(self):
        

        loader_table = self._get_common_loader_mapping()
        loader_table.update(
            {
                "asp": HtmlTableTextLoader,
                "aspx": HtmlTableTextLoader,
                "htm": HtmlTableTextLoader,
                "md": MarkdownTableTextLoader,
                "sqlite3": SqliteFileLoader,
                "xls": ExcelTableFileLoader,
                "xlsx": ExcelTableFileLoader,
            }
        )

        return loader_table
318057
def to_dict(self):
        
        return {'domain_type': self.domain_type,
                'max_memory': self.max_memory,
                'current_memory': self.current_memory,
                'num_cpus': self.num_cpus,
                'running': self.is_running(),
                'name': self.name,
                }
224541
def get_format(format_):
    
    format_path = os.getenv('FORMAT_PATH', 'format_files')
    try:
        spec = importlib.util.spec_from_file_location(
            "format_mod", f"{format_path}/{format_}.py")
        format_mod = importlib.util.module_from_spec(spec)
        spec.loader.exec_module(format_mod)
    except FileNotFoundError:
        try:
            format_mod = import_module(f'nerium.schema.{format_}')
        except ModuleNotFoundError:
            format_mod = import_module('nerium.schema.default')
    schema = format_mod.ResultSchema()
    return schema
45357
def as_dict(self):
        
        return {"@module": self.__class__.__module__,
                "@class": self.__class__.__name__, "efermi": self.efermi,
                "energies": list(self.energies),
                "densities": {str(spin): list(dens)
                              for spin, dens in self.densities.items()}}
468865
def find_formatter_class(alias):
    
    for module_name, name, aliases, _, _ in itervalues(FORMATTERS):
        if alias in aliases:
            if name not in _formatter_cache:
                _load_formatters(module_name)
            return _formatter_cache[name]
    for _, cls in find_plugin_formatters():
        if alias in cls.aliases:
            return cls
1140065
def load(self):
        
        if self._dict is None:
            if self.dirty:
                self._dict = self._loader(self.filename)
                self.cache()
            else:
                with open(self.cachename, 'rb') as stream:
                    self._dict = cPickle.load(stream)

        return self._dict
868061
def to_dict(self):
        
        return {
            'type': self.__class__.__name__,
            'element_id': self.element_id,
            'style_class': self.style_class,
            'icon': self.icon,
            'attributes': self.attributes
        }
1070291
def as_dict(self):
        
        return {
            'pip_version': self._pip_version,
            'pip_url': self._pip_url,
            'pip_requirement': self._pip_requirement,
            'pkg_resources_version': self._pkg_resources_version,
            'pkg_resources_url': self._pkg_resources_url,
            'git_tag': self._git_tag,
            'git_commit': self._git_commit,
            'git_remotes': self._git_remotes,
            'git_is_dirty': self._git_is_dirty,
        }
908503
def info(self):
        
        return {
            'key': self.key,
            'processor': self.processor,
            'extractor': self.extractor,
            'output_path': self.output_path,
            'output_format': self.output_format,
            'template': self.template,
            'type': type(self)
        }
148812
def to_json(self):
        

        result = super(UIExtension, self).to_json()
        result.update({
            'extension': self.extension
        })

        return result
963925
def _get_format_name_loader_mapping(self):
        

        loader_table = self._get_common_loader_mapping()
        loader_table.update(
            {
                "excel": ExcelTableFileLoader,
                "json_lines": JsonLinesTableTextLoader,
                "markdown": MarkdownTableTextLoader,
                "mediawiki": MediaWikiTableTextLoader,
                "ssv": CsvTableFileLoader,
            }
        )

        return loader_table
402005
def to_dict(self):
        
        return {
            "title": self.title,
            "language" : self.language,
            "description": self.description,
            "node_id": self.get_node_id().hex,
            "content_id": self.get_content_id().hex,
            "source_domain": self.domain_ns.hex,
            "source_id": self.source_id,
            "author": self.author,
            "aggregator": self.aggregator,
            "provider": self.provider,
            "files" : [f.to_dict() for f in filter(lambda x: x and x.filename, self.files)], # Filter out failed downloads
            "tags": self.tags,
            "kind": self.kind,
            "license": self.license.license_id,
            "license_description": self.license.description,
            "copyright_holder": self.license.copyright_holder,
            "questions": [question.to_dict() for question in self.questions],
            "extra_fields": json.dumps(self.extra_fields),
            "role": self.role,
        }
616661
def as_dict(self):
        
        return {"name": self.name,
                "@module": self.__class__.__module__,
                "@class": self.__class__.__name__}
2681
def get_context_dict(self):
        
        context_dict = {}
        for s in self.sections():
            for k, v in self.manifest.items(s):
                context_dict["%s:%s" % (s, k)] = v
        for k, v in self.inputs.values().items():
            context_dict["config:{0}".format(k)] = v
        context_dict.update(self.additional_context_variables.items())
        context_dict.update(dict([("%s|escaped" % k, re.escape(str(v) or "")) for k, v in context_dict.items()]))
        return context_dict
593404
def as_dict(self):
        
        d = {"@module": self.__class__.__module__,
             "@class": self.__class__.__name__,
             "name": self.name, "options": self.options}
        if len(self.subkeys) > 0:
            subkeys = []
            for subkey in self.subkeys:
                subkeys.append(subkey.as_dict())
            d.update({"subkeys": subkeys})
        return d
1154909
def get_es_mappings(self):
        

        es_mappings = json.loads(requests.get(self.mapping_url).text)
        es_mappings = {"_".join(key.split("_")[:-1]): value['mappings'] \
                       for key, value in es_mappings.items()}
        return es_mappings
739819
def to_dict(self):
        
        expansion_strings = []

        for expansion in self.expansions:
            expansion_strings.extend(expansion.to_strings())

        return {
            self.type: expansion_strings,
        }