Return all the distribution names known to this locator.
439156
def get_distribution_names(self):
        
        result = set()
        for locator in self.locators:
            try:
                result |= locator.get_distribution_names()
            except NotImplementedError:
                pass
        return result
1232186
def collect_loaded_packages() -> List[Tuple[str, str]]:
    
    dists = get_installed_distributions()
    get_dist_files = DistFilesFinder()
    file_table = {}
    for dist in dists:
        for file in get_dist_files(dist):
            file_table[file] = dist
    used_dists = set()
    # we greedily load all values to a list to avoid weird
    # "dictionary changed size during iteration" errors
    for module in list(sys.modules.values()):
        try:
            dist = file_table[module.__file__]
        except (AttributeError, KeyError):
            continue
        used_dists.add(dist)
    return sorted((dist.project_name, dist.version) for dist in used_dists)
486529
def all_names(self):
        """"""
        return [
            _get_variable_names(arr) if not isinstance(arr, ArrayList) else
            arr.all_names
            for arr in self]
854011
def dist_dir(self):
        ''''''
        if self.distribution is None:
            warning('Tried to access {}.dist_dir, but {}.distribution '
                    'is None'.format(self, self))
            exit(1)
        return self.distribution.dist_dir
567577
def get_repositories(self):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_template
        catalogs = self._get_provider_session('repository_lookup_session').get_repositories()
        cat_list = []
        for cat in catalogs:
            cat_list.append(Repository(self._provider_manager, cat, self._runtime, self._proxy))
        return RepositoryList(cat_list)
769065
def list_overlay_names(self):
        """"""
        overlay_names = []
        for fname in _ls(self._overlays_abspath):
            name, ext = os.path.splitext(fname)
            overlay_names.append(name)
        return overlay_names
1156671
def load_all_distributions(self):
        """"""
        distributions = []
        for this in dir(scipy.stats):
            if "fit" in eval("dir(scipy.stats." + this +")"):
                distributions.append(this)
        self.distributions = distributions[:]
1237304
def _list_locators(self):
        
        with _handle_client_exception():
            response = self.client.get_account()

        for container in response[1]:
            yield container.pop('name'), container
47251
def known_dists():
    ''''''
    return (
        dist for dist in pkg_resources.working_set
        if any(k in ENTRYPOINTS for k in dist.get_entry_map().keys())
    )
44448
def _list_distributions(
    conn,
    name=None,
    region=None,
    key=None,
    keyid=None,
    profile=None,
):
    '''
    
    '''
    for dl_ in conn.get_paginator('list_distributions').paginate():
        distribution_list = dl_['DistributionList']
        if 'Items' not in distribution_list:
            # If there are no items, AWS omits the `Items` key for some reason
            continue
        for partial_dist in distribution_list['Items']:
            tags = conn.list_tags_for_resource(Resource=partial_dist['ARN'])
            tags = dict(
                (kv['Key'], kv['Value']) for kv in tags['Tags']['Items']
            )

            id_ = partial_dist['Id']
            if 'Name' not in tags:
                log.warning('CloudFront distribution %s has no Name tag.', id_)
                continue
            distribution_name = tags.pop('Name', None)
            if name is not None and distribution_name != name:
                continue

            # NOTE: list_distributions() returns a DistributionList,
            # which nominally contains a list of Distribution objects.
            # However, they are mangled in that they are missing values
            # (`Logging`, `ActiveTrustedSigners`, and `ETag` keys)
            # and moreover flatten the normally nested DistributionConfig
            # attributes to the top level.
            # Hence, we must call get_distribution() to get the full object,
            # and we cache these objects to help lessen API calls.
            distribution = _cache_id(
                'cloudfront',
                sub_resource=distribution_name,
                region=region,
                key=key,
                keyid=keyid,
                profile=profile,
            )
            if distribution:
                yield (distribution_name, distribution)
                continue

            dist_with_etag = conn.get_distribution(Id=id_)
            distribution = {
                'distribution': dist_with_etag['Distribution'],
                'etag': dist_with_etag['ETag'],
                'tags': tags,
            }
            _cache_id(
                'cloudfront',
                sub_resource=distribution_name,
                resource_id=distribution,
                region=region,
                key=key,
                keyid=keyid,
                profile=profile,
            )
            yield (distribution_name, distribution)
365398
def find_owners(path):
    """"""
    abspath = os.path.abspath(path)

    packages = search_packages_info(
        sorted((d.project_name for d in
                get_installed_distributions(user_only=ENABLE_USER_SITE)),
               key=lambda d: d.lower()))

    return [p['name'] for p in packages if is_owner(p, abspath)]
64628
def fetch_releases(self, package_name):
        """"""
        package_name = self.source.normalize_package_name(package_name)
        releases = self.source.get_package_versions(package_name)
        releases_with_index_url = [(item, self.index_url) for item in releases]
        return package_name, releases_with_index_url
1368845
def _list_locators(self):
        
        with _handle_azure_exception():
            for share in self.client.list_shares():
                yield share.name, self._model_to_dict(share)
591964
def find_distributions(path_item, only=False):
    """"""
    importer = get_importer(path_item)
    finder = _find_adapter(_distribution_finders, importer)
    return finder(importer, path_item, only)
341655
def get_paths(cls, packages):
        """"""
        allowable_packages = dict((app_config.name, app_config) for app_config in apps.get_app_configs())
        app_configs = [allowable_packages[p] for p in packages if p in allowable_packages]
        # paths of requested packages
        return [os.path.join(app.path, 'locale') for app in app_configs]
246098
def get_all_names(self):
        """"""
        result = set()
        for module in self.names:
            result.update(set(self.names[module]))
        return result
1166252
def get_catalogs(self):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_template
        catalogs = self._get_provider_session('catalog_lookup_session').get_catalogs()
        cat_list = []
        for cat in catalogs:
            cat_list.append(Catalog(self._provider_manager, cat, self._runtime, self._proxy))
        return CatalogList(cat_list)