def names_in_buckets(): in_buckets = {} for name in all_packages(): bucket = LazyBucketDict.bucket(name.replace('_', '-').lower()) if bucket not in in_buckets: in_buckets[bucket] = [] in_buckets[bucket].append(name) return in_buckets
def get_names_per_bucket() -> Dict[str, Set[str]]: result = {} hexdigits = "0123456789abcdef" for a in hexdigits: for b in hexdigits: result[a + b] = set() keys = [p.name for p in P.select(P.name).distinct()] for key in keys: result[LazyBucketDict.bucket(key)].add(key) return result