Returns all metadata extractable from the archive.
        Returns:
            dictionary containing metadata extracted from the archive
9463
def data_from_archive(self):
        
        archive_data = {}

        archive_data['runtime_deps'] = self.runtime_deps
        archive_data['build_deps'] = [
            ['BuildRequires', 'python2-devel']] + self.build_deps

        archive_data['py_modules'] = self.py_modules
        archive_data['scripts'] = self.scripts

        archive_data['home_page'] = self.home_page
        archive_data['description'] = self.description
        archive_data['summary'] = self.summary

        archive_data['license'] = self.license
        archive_data['has_pth'] = self.has_pth
        archive_data['has_extension'] = self.has_extension
        archive_data['has_test_suite'] = self.has_test_suite

        archive_data['python_versions'] = self.versions_from_archive

        (archive_data['doc_files'],
         archive_data['doc_license']) = self.separate_license_files(
             self.doc_files)

        archive_data['dirname'] = self.archive.top_directory

        return archive_data
568162
def all(self):
        
        return self._get_json(HTTPMethods.GET,
                              self._cached_datasets_url,
                              self._get_master_key())
607610
def get_all(self, sort_order=None, sort_target='key'):
        
        return self.get(
            key=_encode(b'\0'),
            metadata=True,
            sort_order=sort_order,
            sort_target=sort_target,
            range_end=_encode(b'\0'),
        )
459905
def get_asset_metadata(self, did):
        
        response = self.requests_session.get(f'{self._base_url}/metadata/{did}').content
        if not response:
            return {}
        try:
            parsed_response = json.loads(response)
        except TypeError:
            parsed_response = None
        except ValueError:
            raise ValueError(response.decode('UTF-8'))
        if parsed_response is None:
            return {}
        return parsed_response['metadata']
705291
def to_json(self):
        
        return {
            'name': self.name,
            'segments': [segment.to_json() for segment in self.segments],
            'meta': self.meta
            }
1228812
def extract_function_metadata(wrapped, instance, args, kwargs, return_value):
    """"""
    LOGGER.debug(
        'Extracting function call metadata',
        args=args,
        kwargs=kwargs,
    )
    return {
        'metadata': {
            'args': args,
            'kwargs': kwargs,
        },
    }
1004550
def metadata(self):
        """"""
        output = dict(self.defaults)
        output.update(self.extra_metadata)
        return output
1093799
def to_dict(self):
        
        return dict(
            variants=self.variants,
            distinct=self.distinct,
            sort_key=self.sort_key,
            sources=self.sources,
            source_to_metadata_dict=self.source_to_metadata_dict)
951528
def get_archive_formats():
    
    formats = [(name, registry[2]) for name, registry in
               _ARCHIVE_FORMATS.items()]
    formats.sort()
    return formats
243226
def global_meta_data(self):
        
        with switch_db(MetaDataModel, 'hyperstream'):
            return sorted(map(lambda x: x.to_dict(), MetaDataModel.objects),
                          key=lambda x: len(x['identifier'].split('.')),
                          reverse=True)
1139826
def metadata(self):
        
        # Check exceptional case: return none if no metadata
        if not self._operation.HasField('metadata'):
            return None

        # Return expected metadata
        return _from_any(self._metadata_type, self._operation.metadata)
350338
def __remove_obsolete_metadata(self):
        
        clean = {}
        for key, _ in self._source_file_names.items():
            if key in self._pystratum_metadata:
                clean[key] = self._pystratum_metadata[key]

        self._pystratum_metadata = clean
287873
def extract_http_metadata(wrapped, instance, args, kwargs, return_value):
    
    response = return_value
    LOGGER.debug(
        'Extracting HTTP metadata',
        args=args,
        kwargs=kwargs,
    )
    if 'request' in kwargs:
        request = kwargs['request']
    else:
        request = args[0]

    metadata = {
        'http': {
            'request': {
                'method': request.method.upper(),
                'url': request.url,
            },
        },
    }
    if response is not None:
        metadata['http']['response'] = {
            'status': response.status_code,
        }

    return metadata
1135573
def metadata_extractor(self):
        
        if not hasattr(self, '_local_file'):
            raise AttributeError("local_file attribute must be set before "
                                 "calling metadata_extractor")
        if not hasattr(self, '_metadata_extractor'):
            if self.local_file.endswith('.whl'):
                logger.info("Getting metadata from wheel using "
                            "WheelMetadataExtractor.")
                extractor_cls = metadata_extractors.WheelMetadataExtractor
            else:
                logger.info("Getting metadata from setup.py using "
                            "SetupPyMetadataExtractor.")
                extractor_cls = metadata_extractors.SetupPyMetadataExtractor

            base_python_version = (
                self.base_python_version or self.template_base_py_ver)

            self._metadata_extractor = extractor_cls(
                self.local_file,
                self.name,
                self.name_convertor,
                self.version,
                self.rpm_name,
                self.venv,
                base_python_version)

        return self._metadata_extractor
1220027
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'value') and self.value is not None:
            _dict['value'] = self.value
        if hasattr(self, 'metadata') and self.metadata is not None:
            _dict['metadata'] = self.metadata
        if hasattr(self, 'value_type') and self.value_type is not None:
            _dict['type'] = self.value_type
        if hasattr(self, 'synonyms') and self.synonyms is not None:
            _dict['synonyms'] = self.synonyms
        if hasattr(self, 'patterns') and self.patterns is not None:
            _dict['patterns'] = self.patterns
        if hasattr(self, 'created') and self.created is not None:
            _dict['created'] = datetime_to_string(self.created)
        if hasattr(self, 'updated') and self.updated is not None:
            _dict['updated'] = datetime_to_string(self.updated)
        return _dict
1300794
def parse_metadata(self):
        """"""

        all_models = defaultdict(list)

        with open(self.metadata_index_json) as f:
            loaded = json.load(f)

        for m in loaded['index']:
            all_models[m['uniprot_ac']].append(m)

        self.all_models = dict(all_models)
871913
def get_metadata(self, key) -> str:
        
        return self.metadata[key] if key in self.metadata else None