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,101
_project_url_base
def _project_url_base(self) -> str: if not all([self.entity, self.project]): return "" app_url = wandb.util.app_url(self.base_url) return f"{app_url}/{quote(self.entity)}/{quote(self.project)}"
python
wandb/sdk/wandb_settings.py
1,082
1,087
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,102
_project_url
def _project_url(self) -> str: project_url = self._project_url_base() if not project_url: return "" query = self._get_url_query_string() return f"{project_url}{query}"
python
wandb/sdk/wandb_settings.py
1,089
1,096
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,103
_run_url
def _run_url(self) -> str: """Return the run url.""" project_url = self._project_url_base() if not all([project_url, self.run_id]): return "" query = self._get_url_query_string() return f"{project_url}/runs/{quote(self.run_id)}{query}"
python
wandb/sdk/wandb_settings.py
1,098
1,105
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,104
_set_run_start_time
def _set_run_start_time(self, source: int = Source.BASE) -> None: """Set the time stamps for the settings. Called once the run is initialized. """ time_stamp: float = time.time() datetime_now: datetime = datetime.fromtimestamp(time_stamp) object.__setattr__(self, "_Setti...
python
wandb/sdk/wandb_settings.py
1,107
1,120
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,105
_sweep_url
def _sweep_url(self) -> str: """Return the sweep url.""" project_url = self._project_url_base() if not all([project_url, self.sweep_id]): return "" query = self._get_url_query_string() return f"{project_url}/sweeps/{quote(self.sweep_id)}{query}"
python
wandb/sdk/wandb_settings.py
1,122
1,129
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,106
__init__
def __init__(self, **kwargs: Any) -> None: self.__frozen: bool = False self.__initialized: bool = False self.__modification_order = SETTINGS_TOPOLOGICALLY_SORTED # todo: this is collect telemetry on validation errors and unexpected args # values are stored as strings to avoid p...
python
wandb/sdk/wandb_settings.py
1,131
1,229
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,107
__str__
def __str__(self) -> str: # get attributes that are instances of the Property class: representation = { k: v.value for k, v in self.__dict__.items() if isinstance(v, Property) } return f"<Settings {_redact_dict(representation)}>"
python
wandb/sdk/wandb_settings.py
1,231
1,236
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,108
__repr__
def __repr__(self) -> str: # private attributes private = {k: v for k, v in self.__dict__.items() if k.startswith("_Settings")} # get attributes that are instances of the Property class: attributes = { k: f"<Property value={v.value} source={v.source}>" for k, v in...
python
wandb/sdk/wandb_settings.py
1,238
1,248
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,109
__copy__
def __copy__(self) -> "Settings": """Ensure that a copy of the settings object is a truly deep copy. Note that the copied object will not be frozen todo? why is this needed? """ # get attributes that are instances of the Property class: attributes = {k: v for k, v in self.__dic...
python
wandb/sdk/wandb_settings.py
1,250
1,270
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,110
__deepcopy__
def __deepcopy__(self, memo: dict) -> "Settings": return self.__copy__()
python
wandb/sdk/wandb_settings.py
1,272
1,273
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,111
__getattribute__
def __getattribute__(self, name: str) -> Any: """Expose `attribute.value` if `attribute` is a Property.""" item = object.__getattribute__(self, name) if isinstance(item, Property): return item.value return item
python
wandb/sdk/wandb_settings.py
1,277
1,282
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,112
__setattr__
def __setattr__(self, key: str, value: Any) -> None: if "_Settings__initialized" in self.__dict__ and self.__initialized: raise TypeError(f"Please use update() to update attribute `{key}` value") object.__setattr__(self, key, value)
python
wandb/sdk/wandb_settings.py
1,284
1,287
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,113
__iter__
def __iter__(self) -> Iterable: return iter(self.make_static())
python
wandb/sdk/wandb_settings.py
1,289
1,290
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,114
copy
def copy(self) -> "Settings": return self.__copy__()
python
wandb/sdk/wandb_settings.py
1,292
1,293
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,115
keys
def keys(self) -> Iterable[str]: return self.make_static().keys()
python
wandb/sdk/wandb_settings.py
1,296
1,297
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,116
__getitem__
def __getitem__(self, name: str) -> Any: """Expose attribute.value if attribute is a Property.""" item = object.__getattribute__(self, name) if isinstance(item, Property): return item.value return item
python
wandb/sdk/wandb_settings.py
1,300
1,305
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,117
update
def update( self, settings: Optional[Union[Dict[str, Any], "Settings"]] = None, source: int = Source.OVERRIDE, **kwargs: Any, ) -> None: """Update individual settings.""" if "_Settings__frozen" in self.__dict__ and self.__frozen: raise TypeError("Settings ...
python
wandb/sdk/wandb_settings.py
1,307
1,375
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,118
items
def items(self) -> ItemsView[str, Any]: return self.make_static().items()
python
wandb/sdk/wandb_settings.py
1,377
1,378
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,119
get
def get(self, key: str, default: Optional[Any] = None) -> Any: return self.make_static().get(key, default)
python
wandb/sdk/wandb_settings.py
1,380
1,381
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,120
freeze
def freeze(self) -> None: object.__setattr__(self, "_Settings__frozen", True)
python
wandb/sdk/wandb_settings.py
1,383
1,384
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,121
unfreeze
def unfreeze(self) -> None: object.__setattr__(self, "_Settings__frozen", False)
python
wandb/sdk/wandb_settings.py
1,386
1,387
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,122
is_frozen
def is_frozen(self) -> bool: return self.__frozen
python
wandb/sdk/wandb_settings.py
1,389
1,390
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,123
make_static
def make_static(self) -> Dict[str, Any]: """Generate a static, serializable version of the settings.""" # get attributes that are instances of the Property class: attributes = { k: v.value for k, v in self.__dict__.items() if isinstance(v, Property) } return attribute...
python
wandb/sdk/wandb_settings.py
1,392
1,398
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,124
_apply_settings
def _apply_settings( self, settings: "Settings", _logger: Optional[_EarlyLogger] = None, ) -> None: """Apply settings from a Settings object.""" if _logger is not None: _logger.info(f"Applying settings from {settings}") attributes = { k: v for ...
python
wandb/sdk/wandb_settings.py
1,402
1,426
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,125
_load_config_file
def _load_config_file(file_name: str, section: str = "default") -> dict: parser = configparser.ConfigParser() parser.add_section(section) parser.read(file_name) config: Dict[str, Any] = dict() for k in parser[section]: config[k] = parser[section][k] # TODO...
python
wandb/sdk/wandb_settings.py
1,429
1,439
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,126
_apply_base
def _apply_base(self, pid: int, _logger: Optional[_EarlyLogger] = None) -> None: if _logger is not None: _logger.info(f"Configure stats pid to {pid}") self.update({"_stats_pid": pid}, source=Source.SETUP)
python
wandb/sdk/wandb_settings.py
1,441
1,444
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,127
_apply_config_files
def _apply_config_files(self, _logger: Optional[_EarlyLogger] = None) -> None: # TODO(jhr): permit setting of config in system and workspace if self.settings_system is not None: if _logger is not None: _logger.info(f"Loading settings from {self.settings_system}") ...
python
wandb/sdk/wandb_settings.py
1,446
1,461
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,128
_apply_env_vars
def _apply_env_vars( self, environ: Mapping[str, Any], _logger: Optional[_EarlyLogger] = None, ) -> None: env_prefix: str = "WANDB_" special_env_var_names = { "WANDB_TRACELOG": "_tracelog", "WANDB_DISABLE_SERVICE": "_disable_service", "WAND...
python
wandb/sdk/wandb_settings.py
1,463
1,501
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,129
_infer_settings_from_environment
def _infer_settings_from_environment( self, _logger: Optional[_EarlyLogger] = None ) -> None: """Modify settings based on environment (for runs and cli).""" settings: Dict[str, Union[bool, str, Sequence, None]] = dict() # disable symlinks if on windows (requires admin or developer se...
python
wandb/sdk/wandb_settings.py
1,503
1,587
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,130
_infer_run_settings_from_environment
def _infer_run_settings_from_environment( self, _logger: Optional[_EarlyLogger] = None, ) -> None: """Modify settings based on environment (for runs only).""" # If there's not already a program file, infer it now. settings: Dict[str, Union[bool, str, None]] = dict() p...
python
wandb/sdk/wandb_settings.py
1,589
1,612
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,131
_apply_setup
def _apply_setup( self, setup_settings: Dict[str, Any], _logger: Optional[_EarlyLogger] = None ) -> None: if _logger: _logger.info(f"Applying setup settings: {_redact_dict(setup_settings)}") self.update(setup_settings, source=Source.SETUP)
python
wandb/sdk/wandb_settings.py
1,614
1,619
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,132
_apply_user
def _apply_user( self, user_settings: Dict[str, Any], _logger: Optional[_EarlyLogger] = None ) -> None: if _logger: _logger.info(f"Applying user settings: {_redact_dict(user_settings)}") self.update(user_settings, source=Source.USER)
python
wandb/sdk/wandb_settings.py
1,621
1,626
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,133
_apply_init
def _apply_init(self, init_settings: Dict[str, Union[str, int, None]]) -> None: # prevent setting project, entity if in sweep # TODO(jhr): these should be locked elements in the future if self.sweep_id: for key in ("project", "entity", "id"): val = init_settings.pop(k...
python
wandb/sdk/wandb_settings.py
1,628
1,693
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,134
_apply_login
def _apply_login( self, login_settings: Dict[str, Any], _logger: Optional[_EarlyLogger] = None ) -> None: param_map = dict(key="api_key", host="base_url", timeout="login_timeout") login_settings = { param_map.get(k, k): v for k, v in login_settings.items() if v is not None ...
python
wandb/sdk/wandb_settings.py
1,695
1,705
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,135
_apply_run_start
def _apply_run_start(self, run_start_settings: Dict[str, Any]) -> None: # This dictionary maps from the "run message dict" to relevant fields in settings # Note: that config is missing param_map = { "run_id": "run_id", "entity": "entity", "project": "project",...
python
wandb/sdk/wandb_settings.py
1,707
1,731
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,136
_get_dict
def _get_dict(d): if isinstance(d, dict): return d # assume argparse Namespace return vars(d)
python
wandb/sdk/wandb_summary.py
7
11
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,137
_as_dict
def _as_dict(self): raise NotImplementedError
python
wandb/sdk/wandb_summary.py
21
22
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,138
_update
def _update(self, record: SummaryRecord): raise NotImplementedError
python
wandb/sdk/wandb_summary.py
25
26
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,139
keys
def keys(self): return [k for k in self._as_dict().keys() if k != "_wandb"]
python
wandb/sdk/wandb_summary.py
28
29
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,140
get
def get(self, key, default=None): return self._as_dict().get(key, default)
python
wandb/sdk/wandb_summary.py
31
32
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,141
__getitem__
def __getitem__(self, key): item = self._as_dict()[key] if isinstance(item, dict): # this nested dict needs to be wrapped: wrapped_item = SummarySubDict() object.__setattr__(wrapped_item, "_items", item) object.__setattr__(wrapped_item, "_parent", self) ...
python
wandb/sdk/wandb_summary.py
34
47
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,142
__setitem__
def __setitem__(self, key, val): self.update({key: val})
python
wandb/sdk/wandb_summary.py
51
52
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,143
__delattr__
def __delattr__(self, key): record = SummaryRecord() item = SummaryItem() item.key = (key,) record.remove = (item,) self._update(record)
python
wandb/sdk/wandb_summary.py
56
61
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,144
update
def update(self, d: t.Dict): # import ipdb; ipdb.set_trace() record = SummaryRecord() for key, value in d.items(): item = SummaryItem() item.key = (key,) item.value = value record.update.append(item) self._update(record)
python
wandb/sdk/wandb_summary.py
65
74
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,145
__init__
def __init__(self, get_current_summary_callback: t.Callable): super().__init__() object.__setattr__(self, "_update_callback", None) object.__setattr__( self, "_get_current_summary_callback", get_current_summary_callback )
python
wandb/sdk/wandb_summary.py
113
118
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,146
_set_update_callback
def _set_update_callback(self, update_callback: t.Callable): object.__setattr__(self, "_update_callback", update_callback)
python
wandb/sdk/wandb_summary.py
120
121
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,147
_as_dict
def _as_dict(self): return self._get_current_summary_callback()
python
wandb/sdk/wandb_summary.py
123
124
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,148
_update
def _update(self, record: SummaryRecord): if self._update_callback: self._update_callback(record)
python
wandb/sdk/wandb_summary.py
126
128
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,149
__init__
def __init__(self): object.__setattr__(self, "_items", dict()) object.__setattr__(self, "_parent", None) object.__setattr__(self, "_parent_key", None)
python
wandb/sdk/wandb_summary.py
141
144
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,150
_as_dict
def _as_dict(self): return self._items
python
wandb/sdk/wandb_summary.py
146
147
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,151
_update
def _update(self, record: SummaryRecord): return self._parent._update(record._add_next_parent(self._parent_key))
python
wandb/sdk/wandb_summary.py
149
150
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,152
watch
def watch( models, criterion=None, log: Optional[Literal["gradients", "parameters", "all"]] = "gradients", log_freq: int = 1000, idx: Optional[int] = None, log_graph: bool = False, ): """Hook into the torch model to collect gradients and the topology. Should be extended to accept arbitr...
python
wandb/sdk/wandb_watch.py
20
106
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,153
unwatch
def unwatch(models=None): """Remove pytorch model topology, gradient and parameter hooks. Args: models: (list) Optional list of pytorch models that have had watch called on them """ if models: if not isinstance(models, (tuple, list)): models = (models,) for model in ...
python
wandb/sdk/wandb_watch.py
109
128
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,154
_handle_host_wandb_setting
def _handle_host_wandb_setting(host: Optional[str], cloud: bool = False) -> None: """Write the host parameter to the global settings file. This takes the parameter from wandb.login or wandb login for use by the application's APIs. """ _api = InternalApi() if host == "https://api.wandb.ai" or (h...
python
wandb/sdk/wandb_login.py
28
43
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,155
login
def login( anonymous: Optional[Literal["must", "allow", "never"]] = None, key: Optional[str] = None, relogin: Optional[bool] = None, host: Optional[str] = None, force: Optional[bool] = None, timeout: Optional[int] = None, ) -> bool: """Log in to W&B. Arguments: anonymous: (strin...
python
wandb/sdk/wandb_login.py
46
78
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,156
__init__
def __init__(self): self.kwargs: Optional[Dict] = None self._settings: Union[Settings, Dict[str, Any], None] = None self._backend = None self._silent = None self._entity = None self._wl = None self._key = None self._relogin = None
python
wandb/sdk/wandb_login.py
89
97
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,157
setup
def setup(self, kwargs): self.kwargs = kwargs # built up login settings login_settings: Settings = wandb.Settings() settings_param = kwargs.pop("_settings", None) # note that this case does not come up anywhere except for the tests if settings_param is not None: ...
python
wandb/sdk/wandb_login.py
99
118
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,158
is_apikey_configured
def is_apikey_configured(self): return apikey.api_key(settings=self._settings) is not None
python
wandb/sdk/wandb_login.py
120
121
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,159
set_backend
def set_backend(self, backend): self._backend = backend
python
wandb/sdk/wandb_login.py
123
124
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,160
set_silent
def set_silent(self, silent: bool): self._silent = silent
python
wandb/sdk/wandb_login.py
126
127
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,161
set_entity
def set_entity(self, entity: str): self._entity = entity
python
wandb/sdk/wandb_login.py
129
130
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,162
login
def login(self): apikey_configured = self.is_apikey_configured() if self._settings.relogin or self._relogin: apikey_configured = False if not apikey_configured: return False if not self._silent: self.login_display() return apikey_configured
python
wandb/sdk/wandb_login.py
132
142
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,163
login_display
def login_display(self): username = self._wl._get_username() if username: # check to see if we got an entity from the setup call or from the user entity = self._entity or self._wl._get_entity() entity_str = "" # check if entity exist, valid (is part of a...
python
wandb/sdk/wandb_login.py
144
166
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,164
configure_api_key
def configure_api_key(self, key): if self._settings._jupyter and not self._settings.silent: wandb.termwarn( "If you're specifying your api key in code, ensure this " "code is not shared publicly.\nConsider setting the " "WANDB_API_KEY environment varia...
python
wandb/sdk/wandb_login.py
168
178
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,165
update_session
def update_session( self, key: Optional[str], status: ApiKeyStatus = ApiKeyStatus.VALID ) -> None: _logger = wandb.setup()._get_logger() login_settings = dict() if status == ApiKeyStatus.OFFLINE: login_settings = dict(mode="offline") elif status == ApiKeyStatus.DI...
python
wandb/sdk/wandb_login.py
180
195
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,166
_prompt_api_key
def _prompt_api_key(self) -> Tuple[Optional[str], ApiKeyStatus]: api = Api(self._settings) while True: try: key = apikey.prompt_api_key( self._settings, api=api, no_offline=self._settings.force if self._settings else...
python
wandb/sdk/wandb_login.py
197
218
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,167
prompt_api_key
def prompt_api_key(self): key, status = self._prompt_api_key() if status == ApiKeyStatus.NOTTY: directive = ( "wandb login [your_api_key]" if self._settings._cli_only_mode else "wandb.login(key=[your_api_key])" ) raise U...
python
wandb/sdk/wandb_login.py
220
231
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,168
propogate_login
def propogate_login(self): # TODO(jhr): figure out if this is really necessary if self._backend: # TODO: calling this twice is gross, this deserves a refactor # Make sure our backend picks up the new creds # _ = self._backend.interface.communicate_login(key, anonymous...
python
wandb/sdk/wandb_login.py
233
239
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,169
_login
def _login( anonymous: Optional[Literal["must", "allow", "never"]] = None, key: Optional[str] = None, relogin: Optional[bool] = None, host: Optional[str] = None, force: Optional[bool] = None, timeout: Optional[int] = None, _backend=None, _silent: Optional[bool] = None, _disable_warni...
python
wandb/sdk/wandb_login.py
242
303
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,170
__init__
def __init__( self, name: str, step_metric: Optional[str] = None, step_sync: Optional[bool] = None, hidden: Optional[bool] = None, summary: Optional[Sequence[str]] = None, goal: Optional[str] = None, overwrite: Optional[bool] = None, ) -> None: ...
python
wandb/sdk/wandb_metric.py
23
42
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,171
_set_callback
def _set_callback(self, cb: Callable[[pb.MetricRecord], None]) -> None: self._callback = cb
python
wandb/sdk/wandb_metric.py
44
45
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,172
name
def name(self) -> str: return self._name
python
wandb/sdk/wandb_metric.py
48
49
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,173
step_metric
def step_metric(self) -> Optional[str]: return self._step_metric
python
wandb/sdk/wandb_metric.py
52
53
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,174
step_sync
def step_sync(self) -> Optional[bool]: return self._step_sync
python
wandb/sdk/wandb_metric.py
56
57
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,175
summary
def summary(self) -> Optional[Tuple[str, ...]]: if self._summary is None: return None return tuple(self._summary)
python
wandb/sdk/wandb_metric.py
60
63
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,176
hidden
def hidden(self) -> Optional[bool]: return self._hidden
python
wandb/sdk/wandb_metric.py
66
67
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,177
goal
def goal(self) -> Optional[str]: goal_dict = dict(min="minimize", max="maximize") return goal_dict[self._goal] if self._goal else None
python
wandb/sdk/wandb_metric.py
70
72
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,178
_commit
def _commit(self) -> None: m = pb.MetricRecord() m.options.defined = True if self._name.endswith("*"): m.glob_name = self._name else: m.name = self._name if self._step_metric: m.step_metric = self._step_metric if self._step_sync: ...
python
wandb/sdk/wandb_metric.py
74
110
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,179
__init__
def __init__(self, features: Union[str, Sequence[str]]) -> None: self._features = ( tuple([features]) if isinstance(features, str) else tuple(features) )
python
wandb/sdk/wandb_require.py
25
28
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,180
require_require
def require_require(self) -> None: pass
python
wandb/sdk/wandb_require.py
30
31
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,181
_require_service
def _require_service(self) -> None: wandb.teardown = wandb._teardown # type: ignore wandb.attach = wandb._attach # type: ignore wandb_run.Run.detach = wandb_run.Run._detach # type: ignore
python
wandb/sdk/wandb_require.py
33
36
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,182
require_service
def require_service(self) -> None: self._require_service()
python
wandb/sdk/wandb_require.py
38
39
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,183
apply
def apply(self) -> None: """Call require_* method for supported features.""" last_message: str = "" for feature_item in self._features: full_feature = feature_item.split("@", 2)[0] feature = full_feature.split(":", 2)[0] func_str = "require_{}".format(feature....
python
wandb/sdk/wandb_require.py
41
59
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,184
require
def require( requirement: Optional[Union[str, Sequence[str]]] = None, experiment: Optional[Union[str, Sequence[str]]] = None, ) -> None: """Indicate which experimental features are used by the script. Args: requirement: (str or list) Features to require experiment: (str or list) Feature...
python
wandb/sdk/wandb_require.py
62
80
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,185
_import_module_hook
def _import_module_hook() -> None: """On wandb import, setup anything needed based on parent process require calls.""" # TODO: optimize by caching which pids this has been done for or use real import hooks # TODO: make this more generic, but for now this works require("service")
python
wandb/sdk/wandb_require.py
83
87
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,186
_get_sweep_url
def _get_sweep_url(api, sweep_id): """Return sweep url if we can figure it out.""" if api.api_key: if api.settings("entity") is None: viewer = api.viewer() if viewer.get("entity"): api.set_setting("entity", viewer["entity"]) project = api.settings("project...
python
wandb/sdk/wandb_sweep.py
12
28
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,187
sweep
def sweep( sweep: Union[dict, Callable], entity: Optional[str] = None, project: Optional[str] = None, ) -> str: """Initialize a hyperparameter sweep. To generate hyperparameter suggestions from the sweep and use them to train a model, call `wandb.agent` with the sweep_id returned by this co...
python
wandb/sdk/wandb_sweep.py
31
116
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,188
controller
def controller( sweep_id_or_config: Optional[Union[str, Dict]] = None, entity: Optional[str] = None, project: Optional[str] = None, ): """Public sweep controller constructor. Usage: ```python import wandb tuner = wandb.controller(...) print(tuner.sweep_config) ...
python
wandb/sdk/wandb_sweep.py
119
143
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,189
__init__
def __init__(self, token: str) -> None: self._token_str = token self._parse()
python
wandb/sdk/wandb_manager.py
46
48
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,190
from_environment
def from_environment(cls) -> Optional["_ManagerToken"]: token = os.environ.get(env.SERVICE) if not token: return None return cls(token=token)
python
wandb/sdk/wandb_manager.py
51
55
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,191
from_params
def from_params(cls, transport: str, host: str, port: int) -> "_ManagerToken": version = cls._version pid = os.getpid() token = "-".join([version, str(pid), transport, host, str(port)]) return cls(token=token)
python
wandb/sdk/wandb_manager.py
58
62
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,192
set_environment
def set_environment(self) -> None: os.environ[env.SERVICE] = self._token_str
python
wandb/sdk/wandb_manager.py
64
65
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,193
_parse
def _parse(self) -> None: assert self._token_str parts = self._token_str.split("-") assert len(parts) == 5, f"token must have 5 parts: {parts}" # TODO: make more robust? version, pid_str, transport, host, port_str = parts assert version == self._version assert tra...
python
wandb/sdk/wandb_manager.py
67
78
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,194
reset_environment
def reset_environment(self) -> None: os.environ.pop(env.SERVICE, None)
python
wandb/sdk/wandb_manager.py
80
81
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,195
token
def token(self) -> str: return self._token_str
python
wandb/sdk/wandb_manager.py
84
85
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,196
pid
def pid(self) -> int: return self._pid
python
wandb/sdk/wandb_manager.py
88
89
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,197
transport
def transport(self) -> str: return self._transport
python
wandb/sdk/wandb_manager.py
92
93
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,198
host
def host(self) -> str: return self._host
python
wandb/sdk/wandb_manager.py
96
97
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,199
port
def port(self) -> int: return self._port
python
wandb/sdk/wandb_manager.py
100
101
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,200
_service_connect
def _service_connect(self) -> None: port = self._token.port svc_iface = self._get_service_interface() try: svc_iface._svc_connect(port=port) except ConnectionRefusedError as e: if not psutil.pid_exists(self._token.pid): message = ( ...
python
wandb/sdk/wandb_manager.py
111
127
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }