MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / _parse_config

Method _parse_config

join/LSH/datasketch/storage.py:966–979  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

964 return self._name + key
965
966 def _parse_config(self, config):
967 cfg = {}
968 for key, value in config.items():
969 # If the value is a plain str, we will use the value
970 # If the value is a dict, we will extract the name of an environment
971 # variable stored under 'env' and optionally a default, stored under
972 # 'default'.
973 # (This is useful if the database relocates to a different host
974 # during the lifetime of the LSH object)
975 if isinstance(value, dict):
976 if 'env' in value:
977 value = os.getenv(value['env'], value.get('default', None))
978 cfg[key] = value
979 return cfg
980
981 def __getstate__(self):
982 state = self.__dict__.copy()

Callers 2

__init__Method · 0.95
statusMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected