id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
3,201 | __init__ | def __init__(self, settings: "Settings") -> None:
# TODO: warn if user doesn't have grpc installed
from wandb.sdk.service import service
self._settings = settings
self._atexit_lambda = None
self._hooks = None
self._service = service._Service(settings=self._settings)
... | python | wandb/sdk/wandb_manager.py | 129 | 163 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,202 | _atexit_setup | def _atexit_setup(self) -> None:
self._atexit_lambda = lambda: self._atexit_teardown()
self._hooks = ExitHooks()
self._hooks.hook()
atexit.register(self._atexit_lambda) | python | wandb/sdk/wandb_manager.py | 165 | 170 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,203 | _atexit_teardown | def _atexit_teardown(self) -> None:
trigger.call("on_finished")
exit_code = self._hooks.exit_code if self._hooks else 0
self._teardown(exit_code) | python | wandb/sdk/wandb_manager.py | 172 | 175 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,204 | _teardown | def _teardown(self, exit_code: int) -> None:
unregister_all_post_import_hooks()
if self._atexit_lambda:
atexit.unregister(self._atexit_lambda)
self._atexit_lambda = None
try:
self._inform_teardown(exit_code)
result = self._service.join()
... | python | wandb/sdk/wandb_manager.py | 177 | 195 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,205 | _get_service | def _get_service(self) -> "service._Service":
return self._service | python | wandb/sdk/wandb_manager.py | 197 | 198 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,206 | _get_service_interface | def _get_service_interface(self) -> "ServiceInterface":
assert self._service
svc_iface = self._service.service_interface
assert svc_iface
return svc_iface | python | wandb/sdk/wandb_manager.py | 200 | 204 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,207 | _inform_init | def _inform_init(self, settings: "Settings", run_id: str) -> None:
svc_iface = self._get_service_interface()
svc_iface._svc_inform_init(settings=settings, run_id=run_id) | python | wandb/sdk/wandb_manager.py | 206 | 208 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,208 | _inform_start | def _inform_start(self, settings: "Settings", run_id: str) -> None:
svc_iface = self._get_service_interface()
svc_iface._svc_inform_start(settings=settings, run_id=run_id) | python | wandb/sdk/wandb_manager.py | 210 | 212 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,209 | _inform_attach | def _inform_attach(self, attach_id: str) -> Optional[Dict[str, Any]]:
svc_iface = self._get_service_interface()
try:
response = svc_iface._svc_inform_attach(attach_id=attach_id)
except Exception:
return None
return settings_dict_from_pbmap(response._settings_map) | python | wandb/sdk/wandb_manager.py | 214 | 220 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,210 | _inform_finish | def _inform_finish(self, run_id: Optional[str] = None) -> None:
svc_iface = self._get_service_interface()
svc_iface._svc_inform_finish(run_id=run_id) | python | wandb/sdk/wandb_manager.py | 222 | 224 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,211 | _inform_teardown | def _inform_teardown(self, exit_code: int) -> None:
svc_iface = self._get_service_interface()
svc_iface._svc_inform_teardown(exit_code) | python | wandb/sdk/wandb_manager.py | 226 | 228 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,212 | _set_logger | def _set_logger(log_object: Logger) -> None:
"""Configure module logger."""
global logger
logger = log_object | python | wandb/sdk/wandb_setup.py | 36 | 39 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,213 | __init__ | def __init__(self) -> None:
self._log: List[tuple] = []
self._exception: List[tuple] = []
# support old warn() as alias of warning()
self.warn = self.warning | python | wandb/sdk/wandb_setup.py | 45 | 49 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,214 | debug | def debug(self, msg: str, *args: Any, **kwargs: Any) -> None:
self._log.append((logging.DEBUG, msg, args, kwargs)) | python | wandb/sdk/wandb_setup.py | 51 | 52 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,215 | info | def info(self, msg: str, *args: Any, **kwargs: Any) -> None:
self._log.append((logging.INFO, msg, args, kwargs)) | python | wandb/sdk/wandb_setup.py | 54 | 55 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,216 | warning | def warning(self, msg: str, *args: Any, **kwargs: Any) -> None:
self._log.append((logging.WARNING, msg, args, kwargs)) | python | wandb/sdk/wandb_setup.py | 57 | 58 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,217 | error | def error(self, msg: str, *args: Any, **kwargs: Any) -> None:
self._log.append((logging.ERROR, msg, args, kwargs)) | python | wandb/sdk/wandb_setup.py | 60 | 61 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,218 | critical | def critical(self, msg: str, *args: Any, **kwargs: Any) -> None:
self._log.append((logging.CRITICAL, msg, args, kwargs)) | python | wandb/sdk/wandb_setup.py | 63 | 64 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,219 | exception | def exception(self, msg: str, *args: Any, **kwargs: Any) -> None:
self._exception.append((msg, args, kwargs)) | python | wandb/sdk/wandb_setup.py | 66 | 67 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,220 | log | def log(self, level: str, msg: str, *args: Any, **kwargs: Any) -> None:
self._log.append((level, msg, args, kwargs)) | python | wandb/sdk/wandb_setup.py | 69 | 70 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,221 | _flush | def _flush(self) -> None:
assert self is not logger
assert logger is not None
for level, msg, args, kwargs in self._log:
logger.log(level, msg, *args, **kwargs)
for msg, args, kwargs in self._exception:
logger.exception(msg, *args, **kwargs) | python | wandb/sdk/wandb_setup.py | 72 | 78 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,222 | __init__ | def __init__(
self,
pid: int,
settings: Optional[Settings] = None,
environ: Optional[Dict[str, Any]] = None,
) -> None:
self._environ = environ or dict(os.environ)
self._sweep_config: Optional[Dict[str, Any]] = None
self._config: Optional[Dict[str, Any]] = Non... | python | wandb/sdk/wandb_setup.py | 87 | 118 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,223 | _settings_setup | def _settings_setup(
self,
settings: Optional[Settings] = None,
early_logger: Optional[_EarlyLogger] = None,
) -> "wandb_settings.Settings":
s = wandb_settings.Settings()
s._apply_base(pid=self._pid, _logger=early_logger)
s._apply_config_files(_logger=early_logger)
... | python | wandb/sdk/wandb_setup.py | 120 | 140 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,224 | _update | def _update(
self,
settings: Optional[Settings] = None,
) -> None:
if settings is None:
return
# self._settings.unfreeze()
if isinstance(settings, wandb_settings.Settings):
# todo: check the logic here. this _only_ comes up in tests?
self._... | python | wandb/sdk/wandb_setup.py | 142 | 155 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,225 | _update_user_settings | def _update_user_settings(self, settings: Optional[Settings] = None) -> None:
settings = settings or self._settings
# Get rid of cached results to force a refresh.
self._server = None
user_settings = self._load_user_settings(settings=settings)
if user_settings is not None:
... | python | wandb/sdk/wandb_setup.py | 157 | 165 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,226 | _early_logger_flush | def _early_logger_flush(self, new_logger: Logger) -> None:
if not self._early_logger:
return
_set_logger(new_logger)
# self._settings._clear_early_logger()
self._early_logger._flush() | python | wandb/sdk/wandb_setup.py | 167 | 172 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,227 | _get_logger | def _get_logger(self) -> Optional[Logger]:
return logger | python | wandb/sdk/wandb_setup.py | 174 | 175 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,228 | settings | def settings(self) -> "wandb_settings.Settings":
return self._settings | python | wandb/sdk/wandb_setup.py | 178 | 179 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,229 | _get_entity | def _get_entity(self) -> Optional[str]:
if self._settings and self._settings._offline:
return None
if self._server is None:
self._load_viewer()
assert self._server is not None
entity = self._server._viewer.get("entity")
return entity | python | wandb/sdk/wandb_setup.py | 181 | 188 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,230 | _get_username | def _get_username(self) -> Optional[str]:
if self._settings and self._settings._offline:
return None
if self._server is None:
self._load_viewer()
assert self._server is not None
username = self._server._viewer.get("username")
return username | python | wandb/sdk/wandb_setup.py | 190 | 197 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,231 | _get_teams | def _get_teams(self) -> List[str]:
if self._settings and self._settings._offline:
return []
if self._server is None:
self._load_viewer()
assert self._server is not None
teams = self._server._viewer.get("teams")
if teams:
teams = [team["node"]["... | python | wandb/sdk/wandb_setup.py | 199 | 208 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,232 | _load_viewer | def _load_viewer(self, settings: Optional[Settings] = None) -> None:
if self._settings and self._settings._offline:
return
if isinstance(settings, dict):
settings = wandb_settings.Settings(**settings)
s = server.Server(settings=settings)
s.query_with_timeout()
... | python | wandb/sdk/wandb_setup.py | 210 | 217 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,233 | _load_user_settings | def _load_user_settings(
self, settings: Optional[Settings] = None
) -> Optional[Dict[str, Any]]:
if self._server is None:
self._load_viewer(settings=settings)
# offline?
if self._server is None:
return None
flags = self._server._flags
user_s... | python | wandb/sdk/wandb_setup.py | 219 | 238 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,234 | _check | def _check(self) -> None:
if hasattr(threading, "main_thread"):
if threading.current_thread() is not threading.main_thread():
pass
elif threading.current_thread().name != "MainThread":
print("bad thread2", threading.current_thread().name)
if getattr(sys, "... | python | wandb/sdk/wandb_setup.py | 240 | 247 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,235 | _setup | def _setup(self) -> None:
self._setup_manager()
sweep_path = self._settings.sweep_param_path
if sweep_path:
self._sweep_config = config_util.dict_from_config_file(
sweep_path, must_exist=True
)
# if config_paths was set, read in config dict
... | python | wandb/sdk/wandb_setup.py | 249 | 268 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,236 | _teardown | def _teardown(self, exit_code: Optional[int] = None) -> None:
exit_code = exit_code or 0
self._teardown_manager(exit_code=exit_code) | python | wandb/sdk/wandb_setup.py | 270 | 272 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,237 | _setup_manager | def _setup_manager(self) -> None:
if self._settings._disable_service:
return
self._manager = wandb_manager._Manager(settings=self._settings) | python | wandb/sdk/wandb_setup.py | 274 | 277 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,238 | _teardown_manager | def _teardown_manager(self, exit_code: int) -> None:
if not self._manager:
return
self._manager._teardown(exit_code)
self._manager = None | python | wandb/sdk/wandb_setup.py | 279 | 283 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,239 | _get_manager | def _get_manager(self) -> Optional[wandb_manager._Manager]:
return self._manager | python | wandb/sdk/wandb_setup.py | 285 | 286 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,240 | __init__ | def __init__(self, settings: Optional[Settings] = None) -> None:
pid = os.getpid()
if _WandbSetup._instance and _WandbSetup._instance._pid == pid:
_WandbSetup._instance._update(settings=settings)
return
_WandbSetup._instance = _WandbSetup__WandbSetup(settings=settings, pi... | python | wandb/sdk/wandb_setup.py | 298 | 303 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,241 | __getattr__ | def __getattr__(self, name: str) -> Any:
return getattr(self._instance, name) | python | wandb/sdk/wandb_setup.py | 305 | 306 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,242 | _setup | def _setup(
settings: Optional[Settings] = None,
_reset: bool = False,
) -> Optional["_WandbSetup"]:
"""Set up library context."""
if _reset:
setup_instance = _WandbSetup._instance
if setup_instance:
setup_instance._teardown()
_WandbSetup._instance = None
retu... | python | wandb/sdk/wandb_setup.py | 309 | 321 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,243 | setup | def setup(
settings: Optional[Settings] = None,
) -> Optional["_WandbSetup"]:
ret = _setup(settings=settings)
return ret | python | wandb/sdk/wandb_setup.py | 324 | 328 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,244 | teardown | def teardown(exit_code: Optional[int] = None) -> None:
setup_instance = _WandbSetup._instance
if setup_instance:
setup_instance._teardown(exit_code=exit_code)
_WandbSetup._instance = None | python | wandb/sdk/wandb_setup.py | 331 | 335 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,245 | requires | def requires(requirement: str) -> FuncT: # type: ignore
"""Decorate functions to gate features with wandb.require."""
env_var = requirement_env_var_mapping[requirement]
def deco(func: FuncT) -> FuncT:
@wraps(func)
def wrapper(*args: Any, **kwargs: Any) -> Any:
if not os.getenv(... | python | wandb/sdk/wandb_require_helpers.py | 12 | 27 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,246 | deco | def deco(func: FuncT) -> FuncT:
@wraps(func)
def wrapper(*args: Any, **kwargs: Any) -> Any:
if not os.getenv(env_var):
raise Exception(
f"You need to enable this feature with `wandb.require({requirement!r})`"
)
return func(*args... | python | wandb/sdk/wandb_require_helpers.py | 16 | 25 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,247 | wrapper | def wrapper(*args: Any, **kwargs: Any) -> Any:
if not os.getenv(env_var):
raise Exception(
f"You need to enable this feature with `wandb.require({requirement!r})`"
)
return func(*args, **kwargs) | python | wandb/sdk/wandb_require_helpers.py | 18 | 23 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,248 | __init__ | def __init__(self) -> None:
self._check_if_requirements_met() | python | wandb/sdk/wandb_require_helpers.py | 33 | 34 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,249 | __post_init__ | def __post_init__(self) -> None:
self._check_if_requirements_met() | python | wandb/sdk/wandb_require_helpers.py | 36 | 37 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,250 | _check_if_requirements_met | def _check_if_requirements_met(self) -> None:
env_var = requirement_env_var_mapping[self.requirement]
if not os.getenv(env_var):
raise Exception(
f'You must explicitly enable this feature with `wandb.require("{self.requirement})"'
) | python | wandb/sdk/wandb_require_helpers.py | 39 | 44 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,251 | __init__ | def __init__(
self,
inputs: Union[Sequence, Dict[str, Sequence]],
targets: Optional[Union[Sequence, Dict[str, Sequence]]] = None,
indexes: Optional[List["_TableIndex"]] = None,
validation_row_processor: Optional[Callable] = None,
prediction_row_processor: Optional[Callabl... | python | wandb/sdk/integration_utils/data_logging.py | 33 | 141 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,252 | make_predictions | def make_predictions(
self, predict_fn: Callable
) -> Union[Sequence, Dict[str, Sequence]]:
"""Produce predictions by passing `validation_inputs` to `predict_fn`.
Args:
predict_fn (Callable): Any function which can accept `validation_inputs` and produce
a list of... | python | wandb/sdk/integration_utils/data_logging.py | 143 | 155 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,253 | log_predictions | def log_predictions(
self,
predictions: Union[Sequence, Dict[str, Sequence]],
prediction_col_name: str = "output",
val_ndx_col_name: str = "val_row",
table_name: str = "validation_predictions",
commit: bool = True,
) -> wandb.data_types.Table:
"""Log a set of ... | python | wandb/sdk/integration_utils/data_logging.py | 157 | 204 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,254 | _make_example | def _make_example(data: Any) -> Optional[Union[Dict, Sequence, Any]]:
"""Used to make an example input, target, or output."""
example: Optional[Union[Dict, Sequence, Any]]
if isinstance(data, dict):
example = {}
for key in data:
example[key] = data[key][0]
elif hasattr(data,... | python | wandb/sdk/integration_utils/data_logging.py | 207 | 220 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,255 | _get_example_shape | def _get_example_shape(example: Union[Sequence, Any]):
"""Get the shape of an object if applicable."""
shape = []
if type(example) is not str and hasattr(example, "__len__"):
length = len(example)
shape = [length]
if length > 0:
shape += _get_example_shape(example[0])
... | python | wandb/sdk/integration_utils/data_logging.py | 223 | 231 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,256 | _bind | def _bind(lambda_fn: Callable, **closure_kwargs: Any) -> Callable:
"""Create a closure around a lambda function by binding `closure_kwargs` to the function."""
def closure(*args: Any, **kwargs: Any) -> Any:
_k = {}
_k.update(kwargs)
_k.update(closure_kwargs)
return lambda_fn(*ar... | python | wandb/sdk/integration_utils/data_logging.py | 234 | 243 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,257 | closure | def closure(*args: Any, **kwargs: Any) -> Any:
_k = {}
_k.update(kwargs)
_k.update(closure_kwargs)
return lambda_fn(*args, **_k) | python | wandb/sdk/integration_utils/data_logging.py | 237 | 241 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,258 | _infer_single_example_keyed_processor | def _infer_single_example_keyed_processor(
example: Union[Sequence, Any],
class_labels_table: Optional["wandb.Table"] = None,
possible_base_example: Optional[Union[Sequence, Any]] = None,
) -> Dict[str, Callable]:
"""Infers a processor from a single example.
Infers a processor from a single example... | python | wandb/sdk/integration_utils/data_logging.py | 246 | 343 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,259 | _infer_validation_row_processor | def _infer_validation_row_processor(
example_input: Union[Dict, Sequence],
example_target: Union[Dict, Sequence, Any],
class_labels_table: Optional["wandb.Table"] = None,
input_col_name: str = "input",
target_col_name: str = "target",
) -> Callable:
"""Infers the composit processor for the valid... | python | wandb/sdk/integration_utils/data_logging.py | 346 | 420 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,260 | processor | def processor(ndx, row):
return {key: single_processors[key](ndx, row) for key in single_processors} | python | wandb/sdk/integration_utils/data_logging.py | 417 | 418 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,261 | _infer_prediction_row_processor | def _infer_prediction_row_processor(
example_prediction: Union[Dict, Sequence],
example_input: Union[Dict, Sequence],
class_labels_table: Optional["wandb.Table"] = None,
input_col_name: str = "input",
output_col_name: str = "output",
) -> Callable:
"""Infers the composit processor for the predic... | python | wandb/sdk/integration_utils/data_logging.py | 423 | 471 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,262 | processor | def processor(ndx, row):
return {key: single_processors[key](ndx, row) for key in single_processors} | python | wandb/sdk/integration_utils/data_logging.py | 468 | 469 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,263 | __init__ | def __init__(
self,
mailbox: Mailbox,
record_q: Optional["Queue[pb.Record]"] = None,
result_q: Optional["Queue[pb.Result]"] = None,
relay_q: Optional["Queue[pb.Result]"] = None,
process: Optional[BaseProcess] = None,
process_check: bool = True,
) -> None:
... | python | wandb/sdk/interface/interface_relay.py | 28 | 44 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,264 | _init_router | def _init_router(self) -> None:
if self.record_q and self.result_q and self.relay_q:
self._router = MessageRelayRouter(
request_queue=self.record_q,
response_queue=self.result_q,
relay_queue=self.relay_q,
mailbox=self._mailbox,
... | python | wandb/sdk/interface/interface_relay.py | 46 | 53 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,265 | __init__ | def __init__(
self,
request_queue: "Queue[pb.Record]",
response_queue: "Queue[pb.Result]",
mailbox: Optional[Mailbox] = None,
) -> None:
self._request_queue = request_queue
self._response_queue = response_queue
super().__init__(mailbox=mailbox) | python | wandb/sdk/interface/router_queue.py | 24 | 32 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,266 | _read_message | def _read_message(self) -> Optional["pb.Result"]:
try:
msg = self._response_queue.get(timeout=1)
except queue.Empty:
return None
tracelog.log_message_dequeue(msg, self._response_queue)
return msg | python | wandb/sdk/interface/router_queue.py | 34 | 40 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,267 | _send_message | def _send_message(self, record: "pb.Record") -> None:
tracelog.log_message_queue(record, self._request_queue)
self._request_queue.put(record) | python | wandb/sdk/interface/router_queue.py | 42 | 44 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,268 | __init__ | def __init__(self, fn: Any, xid: str) -> None:
super().__init__()
self._fn = fn
self._xid = xid | python | wandb/sdk/interface/message_future_poll.py | 22 | 25 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,269 | get | def get(self, timeout: Optional[int] = None) -> Optional[pb.Result]:
self._poll(timeout=timeout)
if self._object_ready.is_set():
return self._object
return None | python | wandb/sdk/interface/message_future_poll.py | 27 | 31 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,270 | _poll | def _poll(self, timeout: Optional[int] = None) -> None:
if self._object_ready.is_set():
return
done = False
start_time = time.time()
sleep_time = 0.5
while not done:
result = self._fn(xid=self._xid)
if result:
self._set_object(r... | python | wandb/sdk/interface/message_future_poll.py | 33 | 50 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,271 | __init__ | def __init__(self):
self.update = []
self.remove = [] | python | wandb/sdk/interface/summary_record.py | 16 | 18 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,272 | __str__ | def __str__(self):
s = "SummaryRecord:\n Update:\n "
s += "\n ".join([str(item) for item in self.update])
s += "\n Remove:\n "
s += "\n ".join([str(item) for item in self.remove])
s += "\n"
return s | python | wandb/sdk/interface/summary_record.py | 20 | 26 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,273 | _add_next_parent | def _add_next_parent(self, parent_key):
with_next_parent = SummaryRecord()
with_next_parent.update = [
item._add_next_parent(parent_key) for item in self.update
]
with_next_parent.remove = [
item._add_next_parent(parent_key) for item in self.remove
]
... | python | wandb/sdk/interface/summary_record.py | 30 | 39 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,274 | __init__ | def __init__(self):
self.key = tuple()
self.value = None | python | wandb/sdk/interface/summary_record.py | 48 | 50 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,275 | __str__ | def __str__(self):
return "SummaryItem: key: " + str(self.key) + " value: " + str(self.value) | python | wandb/sdk/interface/summary_record.py | 52 | 53 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,276 | _add_next_parent | def _add_next_parent(self, parent_key):
with_next_parent = SummaryItem()
key = self.key
if not isinstance(key, tuple):
key = (key,)
with_next_parent.key = (parent_key,) + self.key
with_next_parent.value = self.value
return with_next_parent | python | wandb/sdk/interface/summary_record.py | 57 | 67 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,277 | file_policy_to_enum | def file_policy_to_enum(policy: "PolicyName") -> "pb.FilesItem.PolicyType.V":
if policy == "now":
enum = pb.FilesItem.PolicyType.NOW
elif policy == "end":
enum = pb.FilesItem.PolicyType.END
elif policy == "live":
enum = pb.FilesItem.PolicyType.LIVE
return enum | python | wandb/sdk/interface/interface.py | 59 | 66 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,278 | file_enum_to_policy | def file_enum_to_policy(enum: "pb.FilesItem.PolicyType.V") -> "PolicyName":
if enum == pb.FilesItem.PolicyType.NOW:
policy: PolicyName = "now"
elif enum == pb.FilesItem.PolicyType.END:
policy = "end"
elif enum == pb.FilesItem.PolicyType.LIVE:
policy = "live"
return policy | python | wandb/sdk/interface/interface.py | 69 | 76 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,279 | __init__ | def __init__(self) -> None:
self._run = None
self._drop = False | python | wandb/sdk/interface/interface.py | 83 | 85 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,280 | _hack_set_run | def _hack_set_run(self, run: "Run") -> None:
self._run = run
current_pid = os.getpid()
self._run._set_iface_pid(current_pid) | python | wandb/sdk/interface/interface.py | 87 | 90 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,281 | publish_header | def publish_header(self) -> None:
header = pb.HeaderRecord()
self._publish_header(header) | python | wandb/sdk/interface/interface.py | 92 | 94 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,282 | _publish_header | def _publish_header(self, header: pb.HeaderRecord) -> None:
raise NotImplementedError | python | wandb/sdk/interface/interface.py | 97 | 98 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,283 | communicate_check_version | def communicate_check_version(
self, current_version: Optional[str] = None
) -> Optional[pb.CheckVersionResponse]:
check_version = pb.CheckVersionRequest()
if current_version:
check_version.current_version = current_version
ret = self._communicate_check_version(check_vers... | python | wandb/sdk/interface/interface.py | 100 | 107 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,284 | _communicate_check_version | def _communicate_check_version(
self, current_version: pb.CheckVersionRequest
) -> Optional[pb.CheckVersionResponse]:
raise NotImplementedError | python | wandb/sdk/interface/interface.py | 110 | 113 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,285 | communicate_status | def communicate_status(self) -> Optional[pb.StatusResponse]:
status = pb.StatusRequest()
resp = self._communicate_status(status)
return resp | python | wandb/sdk/interface/interface.py | 115 | 118 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,286 | _communicate_status | def _communicate_status(
self, status: pb.StatusRequest
) -> Optional[pb.StatusResponse]:
raise NotImplementedError | python | wandb/sdk/interface/interface.py | 121 | 124 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,287 | communicate_stop_status | def communicate_stop_status(self) -> Optional[pb.StopStatusResponse]:
status = pb.StopStatusRequest()
resp = self._communicate_stop_status(status)
return resp | python | wandb/sdk/interface/interface.py | 126 | 129 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,288 | _communicate_stop_status | def _communicate_stop_status(
self, status: pb.StopStatusRequest
) -> Optional[pb.StopStatusResponse]:
raise NotImplementedError | python | wandb/sdk/interface/interface.py | 132 | 135 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,289 | communicate_network_status | def communicate_network_status(self) -> Optional[pb.NetworkStatusResponse]:
status = pb.NetworkStatusRequest()
resp = self._communicate_network_status(status)
return resp | python | wandb/sdk/interface/interface.py | 137 | 140 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,290 | _communicate_network_status | def _communicate_network_status(
self, status: pb.NetworkStatusRequest
) -> Optional[pb.NetworkStatusResponse]:
raise NotImplementedError | python | wandb/sdk/interface/interface.py | 143 | 146 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,291 | _make_config | def _make_config(
self,
data: Optional[dict] = None,
key: Optional[Union[Tuple[str, ...], str]] = None,
val: Optional[Any] = None,
obj: Optional[pb.ConfigRecord] = None,
) -> pb.ConfigRecord:
config = obj or pb.ConfigRecord()
if data:
for k, v in d... | python | wandb/sdk/interface/interface.py | 148 | 169 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,292 | _make_run | def _make_run(self, run: "Run") -> pb.RunRecord:
proto_run = pb.RunRecord()
run._make_proto_run(proto_run)
if run._settings.host:
proto_run.host = run._settings.host
if run._config is not None:
config_dict = run._config._as_dict() # type: ignore
self.... | python | wandb/sdk/interface/interface.py | 171 | 181 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,293 | publish_run | def publish_run(self, run: "pb.RunRecord") -> None:
self._publish_run(run) | python | wandb/sdk/interface/interface.py | 183 | 184 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,294 | _publish_run | def _publish_run(self, run: pb.RunRecord) -> None:
raise NotImplementedError | python | wandb/sdk/interface/interface.py | 187 | 188 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,295 | publish_cancel | def publish_cancel(self, cancel_slot: str) -> None:
cancel = pb.CancelRequest(cancel_slot=cancel_slot)
self._publish_cancel(cancel) | python | wandb/sdk/interface/interface.py | 190 | 192 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,296 | _publish_cancel | def _publish_cancel(self, cancel: pb.CancelRequest) -> None:
raise NotImplementedError | python | wandb/sdk/interface/interface.py | 195 | 196 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,297 | publish_config | def publish_config(
self,
data: Optional[dict] = None,
key: Optional[Union[Tuple[str, ...], str]] = None,
val: Optional[Any] = None,
) -> None:
cfg = self._make_config(data=data, key=key, val=val)
self._publish_config(cfg) | python | wandb/sdk/interface/interface.py | 198 | 206 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,298 | _publish_config | def _publish_config(self, cfg: pb.ConfigRecord) -> None:
raise NotImplementedError | python | wandb/sdk/interface/interface.py | 209 | 210 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,299 | _publish_metric | def _publish_metric(self, metric: pb.MetricRecord) -> None:
raise NotImplementedError | python | wandb/sdk/interface/interface.py | 213 | 214 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,300 | communicate_attach | def communicate_attach(self, attach_id: str) -> Optional[pb.AttachResponse]:
attach = pb.AttachRequest(attach_id=attach_id)
resp = self._communicate_attach(attach)
return resp | python | wandb/sdk/interface/interface.py | 216 | 219 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.