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
4,201
send_config
def send_config(self, record: "Record") -> None: cfg = record.config config_util.update_from_proto(self._consolidated_config, cfg) self._update_config()
python
wandb/sdk/internal/sender.py
1,321
1,324
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,202
send_metric
def send_metric(self, record: "Record") -> None: metric = record.metric if metric.glob_name: logger.warning("Seen metric with glob (shouldn't happen)") return # merge or overwrite old_metric = self._config_metric_dict.get( metric.name, wandb_internal_...
python
wandb/sdk/internal/sender.py
1,326
1,363
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,203
_update_telemetry_record
def _update_telemetry_record(self, telemetry: telemetry.TelemetryRecord) -> None: self._telemetry_obj.MergeFrom(telemetry) self._update_config()
python
wandb/sdk/internal/sender.py
1,365
1,367
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,204
send_telemetry
def send_telemetry(self, record: "Record") -> None: self._update_telemetry_record(record.telemetry)
python
wandb/sdk/internal/sender.py
1,369
1,370
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,205
send_request_telemetry_record
def send_request_telemetry_record(self, record: "Record") -> None: self._update_telemetry_record(record.request.telemetry_record.telemetry)
python
wandb/sdk/internal/sender.py
1,372
1,373
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,206
_save_file
def _save_file( self, fname: interface.GlobStr, policy: "interface.PolicyName" = "end" ) -> None: logger.info("saving file %s with policy %s", fname, policy) if self._dir_watcher: self._dir_watcher.update_policy(fname, policy)
python
wandb/sdk/internal/sender.py
1,375
1,380
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,207
send_files
def send_files(self, record: "Record") -> None: files = record.files for k in files.files: # TODO(jhr): fix paths with directories self._save_file( interface.GlobStr(k.path), interface.file_enum_to_policy(k.policy) )
python
wandb/sdk/internal/sender.py
1,382
1,388
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,208
send_header
def send_header(self, record: "Record") -> None: pass
python
wandb/sdk/internal/sender.py
1,390
1,391
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,209
send_footer
def send_footer(self, record: "Record") -> None: pass
python
wandb/sdk/internal/sender.py
1,393
1,394
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,210
send_tbrecord
def send_tbrecord(self, record: "Record") -> None: # tbrecord watching threads are handled by handler.py pass
python
wandb/sdk/internal/sender.py
1,396
1,398
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,211
send_link_artifact
def send_link_artifact(self, record: "Record") -> None: link = record.link_artifact client_id = link.client_id server_id = link.server_id portfolio_name = link.portfolio_name entity = link.portfolio_entity project = link.portfolio_project aliases = link.portfolio_...
python
wandb/sdk/internal/sender.py
1,400
1,417
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,212
send_use_artifact
def send_use_artifact(self, record: "Record") -> None: """Pretend to send a used artifact. This function doesn't actually send anything, it is just used internally. """ use = record.use_artifact if use.type == "job": self._job_builder.disable = True
python
wandb/sdk/internal/sender.py
1,419
1,426
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,213
send_request_log_artifact
def send_request_log_artifact(self, record: "Record") -> None: assert record.control.req_resp result = proto_util._result_from_record(record) artifact = record.request.log_artifact.artifact history_step = record.request.log_artifact.history_step try: res = self._send...
python
wandb/sdk/internal/sender.py
1,428
1,446
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,214
send_request_artifact_send
def send_request_artifact_send(self, record: "Record") -> None: # TODO: combine and eventually remove send_request_log_artifact() # for now, we are using req/resp uuid for transaction id # in the future this should be part of the message to handle idempotency xid = record.uuid ...
python
wandb/sdk/internal/sender.py
1,448
1,468
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,215
send_artifact
def send_artifact(self, record: "Record") -> None: artifact = record.artifact try: res = self._send_artifact(artifact) logger.info(f"sent artifact {artifact.name} - {res}") except Exception as e: logger.error( 'send_artifact: failed for artifac...
python
wandb/sdk/internal/sender.py
1,470
1,480
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,216
_send_artifact
def _send_artifact( self, artifact: "ArtifactRecord", history_step: Optional[int] = None ) -> Optional[Dict]: from pkg_resources import parse_version assert self._pusher saver = artifacts.ArtifactSaver( api=self._api, digest=artifact.digest, manif...
python
wandb/sdk/internal/sender.py
1,482
1,524
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,217
send_alert
def send_alert(self, record: "Record") -> None: from pkg_resources import parse_version alert = record.alert max_cli_version = self._max_cli_version() if max_cli_version is None or parse_version(max_cli_version) < parse_version( "0.10.9" ): logger.warning...
python
wandb/sdk/internal/sender.py
1,526
1,547
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,218
finish
def finish(self) -> None: logger.info("shutting down sender") # if self._tb_watcher: # self._tb_watcher.finish() self._output_raw_finish() if self._dir_watcher: self._dir_watcher.finish() self._dir_watcher = None if self._pusher: se...
python
wandb/sdk/internal/sender.py
1,549
1,564
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,219
_max_cli_version
def _max_cli_version(self) -> Optional[str]: server_info = self.get_server_info() max_cli_version = server_info.get("cliVersionInfo", {}).get( "max_cli_version", None ) if not isinstance(max_cli_version, str): return None return max_cli_version
python
wandb/sdk/internal/sender.py
1,566
1,573
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,220
get_viewer_server_info
def get_viewer_server_info(self) -> None: if self._cached_server_info and self._cached_viewer: return self._cached_viewer, self._cached_server_info = self._api.viewer_server_info()
python
wandb/sdk/internal/sender.py
1,575
1,578
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,221
get_viewer_info
def get_viewer_info(self) -> Dict[str, Any]: if not self._cached_viewer: self.get_viewer_server_info() return self._cached_viewer
python
wandb/sdk/internal/sender.py
1,580
1,583
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,222
get_server_info
def get_server_info(self) -> Dict[str, Any]: if not self._cached_server_info: self.get_viewer_server_info() return self._cached_server_info
python
wandb/sdk/internal/sender.py
1,585
1,588
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,223
get_local_info
def get_local_info(self) -> "LocalInfo": """Queries the server to get the local version information. First, we perform an introspection, if it returns empty we deduce that the docker image is out-of-date. Otherwise, we use the returned values to deduce the state of the local server. ...
python
wandb/sdk/internal/sender.py
1,590
1,615
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,224
_flush_job
def _flush_job(self) -> None: if self._job_builder.disable or self._settings.get("_offline", False): return self._job_builder.set_config( {k: v for k, v in self._consolidated_config.items() if k != "_wandb"} ) summary_dict = self._cached_summary.copy() sum...
python
wandb/sdk/internal/sender.py
1,617
1,639
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,225
__next__
def __next__(self) -> "Record": return self._record_q.get(block=True)
python
wandb/sdk/internal/sender.py
1,641
1,642
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,226
wandb_internal
def wandb_internal( settings: "SettingsDict", record_q: "Queue[Record]", result_q: "Queue[Result]", port: Optional[int] = None, user_pid: Optional[int] = None, ) -> None: """Internal process function entrypoint. Read from record queue and dispatch work to various threads. Arguments: ...
python
wandb/sdk/internal/internal.py
48
185
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,227
handle_exit
def handle_exit(*args: "Any") -> None: logger.info("Internal process exited")
python
wandb/sdk/internal/internal.py
75
76
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,228
close_internal_log
def close_internal_log() -> None: root = logging.getLogger("wandb") for _handler in root.handlers[:]: _handler.close() root.removeHandler(_handler)
python
wandb/sdk/internal/internal.py
165
169
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,229
_setup_tracelog
def _setup_tracelog() -> None: # TODO: remove this temporary hack, need to find a better way to pass settings # to the server. for now lets just look at the environment variable we need tracelog_mode = os.environ.get("WANDB_TRACELOG") if tracelog_mode: tracelog.enable(tracelog_mode)
python
wandb/sdk/internal/internal.py
188
193
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,230
configure_logging
def configure_logging( log_fname: str, log_level: int, run_id: Optional[str] = None ) -> None: # TODO: we may want make prints and stdout make it into the logs # sys.stdout = open(settings.log_internal, "a") # sys.stderr = open(settings.log_internal, "a") log_handler = logging.FileHandler(log_fname)...
python
wandb/sdk/internal/internal.py
196
230
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,231
filter
def filter(self, record: "Any") -> bool: record.run_id = run_id return True
python
wandb/sdk/internal/internal.py
206
208
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,232
__init__
def __init__( self, settings: "SettingsStatic", record_q: "Queue[Record]", result_q: "Queue[Result]", stopped: "Event", writer_q: "Queue[Record]", interface: "InterfaceQueue", context_keeper: context.ContextKeeper, debounce_interval_ms: "float" = 1...
python
wandb/sdk/internal/internal.py
241
265
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,233
_setup
def _setup(self) -> None: self._hm = handler.HandleManager( settings=self._settings, record_q=self._record_q, result_q=self._result_q, stopped=self._stopped, writer_q=self._writer_q, interface=self._interface, context_keeper=sel...
python
wandb/sdk/internal/internal.py
267
276
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,234
_process
def _process(self, record: "Record") -> None: self._hm.handle(record)
python
wandb/sdk/internal/internal.py
278
279
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,235
_finish
def _finish(self) -> None: self._hm.finish()
python
wandb/sdk/internal/internal.py
281
282
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,236
_debounce
def _debounce(self) -> None: self._hm.debounce()
python
wandb/sdk/internal/internal.py
284
285
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,237
__init__
def __init__( self, settings: "SettingsStatic", record_q: "Queue[Record]", result_q: "Queue[Result]", stopped: "Event", interface: "InterfaceQueue", context_keeper: context.ContextKeeper, debounce_interval_ms: "float" = 5000, ) -> None: super()...
python
wandb/sdk/internal/internal.py
295
316
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,238
_setup
def _setup(self) -> None: self._sm = sender.SendManager( settings=self._settings, record_q=self._record_q, result_q=self._result_q, interface=self._interface, context_keeper=self._context_keeper, )
python
wandb/sdk/internal/internal.py
318
325
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,239
_process
def _process(self, record: "Record") -> None: self._sm.send(record)
python
wandb/sdk/internal/internal.py
327
328
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,240
_finish
def _finish(self) -> None: self._sm.finish()
python
wandb/sdk/internal/internal.py
330
331
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,241
_debounce
def _debounce(self) -> None: self._sm.debounce()
python
wandb/sdk/internal/internal.py
333
334
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,242
__init__
def __init__( self, settings: "SettingsStatic", record_q: "Queue[Record]", result_q: "Queue[Result]", stopped: "Event", interface: "InterfaceQueue", sender_q: "Queue[Record]", context_keeper: context.ContextKeeper, debounce_interval_ms: "float" = 1...
python
wandb/sdk/internal/internal.py
344
367
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,243
_setup
def _setup(self) -> None: self._wm = writer.WriteManager( settings=self._settings, record_q=self._record_q, result_q=self._result_q, sender_q=self._sender_q, interface=self._interface, context_keeper=self._context_keeper, )
python
wandb/sdk/internal/internal.py
369
377
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,244
_process
def _process(self, record: "Record") -> None: self._wm.write(record)
python
wandb/sdk/internal/internal.py
379
380
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,245
_finish
def _finish(self) -> None: self._wm.finish()
python
wandb/sdk/internal/internal.py
382
383
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,246
_debounce
def _debounce(self) -> None: self._wm.debounce()
python
wandb/sdk/internal/internal.py
385
386
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,247
__init__
def __init__(self, settings: "SettingsStatic", user_pid: Optional[int]) -> None: self.settings = settings self.pid = user_pid self.check_process_last = None self.check_process_interval = settings._internal_check_process
python
wandb/sdk/internal/internal.py
394
398
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,248
is_dead
def is_dead(self) -> bool: if not self.check_process_interval or not self.pid: return False time_now = time.time() if ( self.check_process_last and time_now < self.check_process_last + self.check_process_interval ): return False sel...
python
wandb/sdk/internal/internal.py
400
418
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,249
__init__
def __init__(self, run_obj, settings, datatypes_cb): super().__init__(settings=settings) self._run_obj = run_obj # TODO: This overwrites what's done in the constructor of wandb_run.Run. # We really want a common interface for wandb_run.Run and InternalRun. _datatypes_set_callbac...
python
wandb/sdk/internal/run.py
13
19
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,250
_set_backend
def _set_backend(self, backend): # This type of run object can't have a backend # or do any writes. pass
python
wandb/sdk/internal/run.py
21
24
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,251
__init__
def __init__(self, settings: SettingsStatic): self._settings = settings self._metadatafile_path = None self._requirements_path = None self._config = None self._summary = None self._logged_code_artifact = None self._disable = settings.disable_job_creation
python
wandb/sdk/internal/job_builder.py
69
76
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,252
set_config
def set_config(self, config: Dict[str, Any]) -> None: self._config = config
python
wandb/sdk/internal/job_builder.py
78
79
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,253
set_summary
def set_summary(self, summary: Dict[str, Any]) -> None: self._summary = summary
python
wandb/sdk/internal/job_builder.py
81
82
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,254
disable
def disable(self) -> bool: return self._disable
python
wandb/sdk/internal/job_builder.py
85
86
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,255
disable
def disable(self, val: bool) -> None: self._disable = val
python
wandb/sdk/internal/job_builder.py
89
90
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,256
_set_logged_code_artifact
def _set_logged_code_artifact( self, res: Optional[Dict], artifact: "ArtifactRecord" ) -> None: if artifact.type == "code" and res is not None: self._logged_code_artifact = ArtifactInfoForJob( { "id": res["id"], "name": artifact.nam...
python
wandb/sdk/internal/job_builder.py
92
101
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,257
_build_repo_job
def _build_repo_job( self, metadata: Dict[str, Any], program_relpath: str ) -> Tuple[Artifact, GitSourceDict]: git_info: Dict[str, str] = metadata.get("git", {}) remote = git_info.get("remote") commit = git_info.get("commit") assert remote is not None assert commit is...
python
wandb/sdk/internal/job_builder.py
103
131
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,258
_build_artifact_job
def _build_artifact_job( self, program_relpath: str ) -> Tuple[Artifact, ArtifactSourceDict]: assert isinstance(self._logged_code_artifact, dict) # TODO: update executable to a method that supports pex source: ArtifactSourceDict = { "entrypoint": [ os.path...
python
wandb/sdk/internal/job_builder.py
133
148
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,259
_build_image_job
def _build_image_job( self, metadata: Dict[str, Any] ) -> Tuple[Artifact, ImageSourceDict]: image_name = metadata.get("docker") assert isinstance(image_name, str) name = make_artifact_name_safe(f"job-{image_name}") artifact = Artifact(name, JOB_ARTIFACT_TYPE) source: ...
python
wandb/sdk/internal/job_builder.py
150
160
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,260
build
def build(self) -> Optional[Artifact]: if not os.path.exists( os.path.join(self._settings.files_dir, REQUIREMENTS_FNAME) ): return None metadata = self._handle_metadata_file() if metadata is None: return None runtime: Optional[str] = metadata....
python
wandb/sdk/internal/job_builder.py
162
219
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,261
_handle_metadata_file
def _handle_metadata_file( self, ) -> Optional[Dict]: if os.path.exists(os.path.join(self._settings.files_dir, METADATA_FNAME)): with open(os.path.join(self._settings.files_dir, METADATA_FNAME)) as f: metadata: Dict = json.load(f) return metadata retu...
python
wandb/sdk/internal/job_builder.py
221
229
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,262
_has_git_job_ingredients
def _has_git_job_ingredients( self, metadata: Dict[str, Any], program_relpath: Optional[str] ) -> bool: git_info: Dict[str, str] = metadata.get("git", {}) return ( git_info.get("remote") is not None and git_info.get("commit") is not None and program_relpat...
python
wandb/sdk/internal/job_builder.py
231
239
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,263
_has_artifact_job_ingredients
def _has_artifact_job_ingredients(self, program_relpath: Optional[str]) -> bool: return self._logged_code_artifact is not None and program_relpath is not None
python
wandb/sdk/internal/job_builder.py
241
242
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,264
_has_image_job_ingredients
def _has_image_job_ingredients(self, metadata: Dict[str, Any]) -> bool: return metadata.get("docker") is not None
python
wandb/sdk/internal/job_builder.py
244
245
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,265
check_httpx_exc_retriable
def check_httpx_exc_retriable(exc: Exception) -> bool: retriable_codes = (308, 408, 409, 429, 500, 502, 503, 504) return ( isinstance(exc, (httpx.TimeoutException, httpx.NetworkError)) or ( isinstance(exc, httpx.HTTPStatusError) and exc.response.status_code in retriable_c...
python
wandb/sdk/internal/internal_api.py
110
124
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,266
__init__
def __init__(self) -> None: self.context = None
python
wandb/sdk/internal/internal_api.py
130
131
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,267
__init__
def __init__( self, default_settings: Optional[ Union[ "wandb.sdk.wandb_settings.Settings", "wandb.sdk.internal.settings_static.SettingsStatic", Settings, dict, ] ] = None, load_settings: bool = True,...
python
wandb/sdk/internal/internal_api.py
153
254
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,268
gql
def gql(self, *args: Any, **kwargs: Any) -> Any: ret = self._retry_gql( *args, retry_cancel_event=self.context.cancel_event, **kwargs, ) return ret
python
wandb/sdk/internal/internal_api.py
256
262
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,269
set_local_context
def set_local_context(self, api_context: Optional[context.Context]) -> None: self._local_data.context = api_context
python
wandb/sdk/internal/internal_api.py
264
265
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,270
clear_local_context
def clear_local_context(self) -> None: self._local_data.context = None
python
wandb/sdk/internal/internal_api.py
267
268
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,271
context
def context(self) -> context.Context: return self._local_data.context or self._global_context
python
wandb/sdk/internal/internal_api.py
271
272
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,272
reauth
def reauth(self) -> None: """Ensure the current api key is set in the transport.""" self.client.transport.auth = ("api", self.api_key or "")
python
wandb/sdk/internal/internal_api.py
274
276
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,273
relocate
def relocate(self) -> None: """Ensure the current api points to the right server.""" self.client.transport.url = "%s/graphql" % self.settings("base_url")
python
wandb/sdk/internal/internal_api.py
278
280
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,274
execute
def execute(self, *args: Any, **kwargs: Any) -> "_Response": """Wrapper around execute that logs in cases of failure.""" try: return self.client.execute(*args, **kwargs) # type: ignore except requests.exceptions.HTTPError as err: response = err.response logge...
python
wandb/sdk/internal/internal_api.py
282
292
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,275
disabled
def disabled(self) -> Union[str, bool]: return self._settings.get(Settings.DEFAULT_SECTION, "disabled", fallback=False) # type: ignore
python
wandb/sdk/internal/internal_api.py
294
295
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,276
set_current_run_id
def set_current_run_id(self, run_id: str) -> None: self._current_run_id = run_id
python
wandb/sdk/internal/internal_api.py
297
298
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,277
current_run_id
def current_run_id(self) -> Optional[str]: return self._current_run_id
python
wandb/sdk/internal/internal_api.py
301
302
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,278
user_agent
def user_agent(self) -> str: return f"W&B Internal Client {__version__}"
python
wandb/sdk/internal/internal_api.py
305
306
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,279
api_key
def api_key(self) -> Optional[str]: auth = requests.utils.get_netrc_auth(self.api_url) key = None if auth: key = auth[-1] # Environment should take precedence env_key: Optional[str] = self._environ.get(env.API_KEY) sagemaker_key: Optional[str] = parse_sm_secr...
python
wandb/sdk/internal/internal_api.py
309
319
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,280
api_url
def api_url(self) -> str: return self.settings("base_url") # type: ignore
python
wandb/sdk/internal/internal_api.py
322
323
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,281
app_url
def app_url(self) -> str: return wandb.util.app_url(self.api_url)
python
wandb/sdk/internal/internal_api.py
326
327
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,282
default_entity
def default_entity(self) -> str: return self.viewer().get("entity") # type: ignore
python
wandb/sdk/internal/internal_api.py
330
331
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,283
settings
def settings(self, key: Optional[str] = None, section: Optional[str] = None) -> Any: """The settings overridden from the wandb/settings file. Arguments: key (str, optional): If provided only this setting is returned section (str, optional): If provided this section of the settin...
python
wandb/sdk/internal/internal_api.py
333
389
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,284
clear_setting
def clear_setting( self, key: str, globally: bool = False, persist: bool = False ) -> None: self._settings.clear( Settings.DEFAULT_SECTION, key, globally=globally, persist=persist )
python
wandb/sdk/internal/internal_api.py
391
396
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,285
set_setting
def set_setting( self, key: str, value: Any, globally: bool = False, persist: bool = False ) -> None: self._settings.set( Settings.DEFAULT_SECTION, key, value, globally=globally, persist=persist ) if key == "entity": env.set_entity(value, env=self._environ) ...
python
wandb/sdk/internal/internal_api.py
398
409
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,286
parse_slug
def parse_slug( self, slug: str, project: Optional[str] = None, run: Optional[str] = None ) -> Tuple[str, str]: """Parse a slug into a project and run. Arguments: slug (str): The slug to parse project (str, optional): The project to use, if not provided it will be ...
python
wandb/sdk/internal/internal_api.py
411
436
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,287
server_info_introspection
def server_info_introspection(self) -> Tuple[List[str], List[str], List[str]]: query_string = """ query ProbeServerCapabilities { QueryType: __type(name: "Query") { ...fieldData } MutationType: __type(name: "Mutation") { ...
python
wandb/sdk/internal/internal_api.py
439
479
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,288
server_settings_introspection
def server_settings_introspection(self) -> None: query_string = """ query ProbeServerSettings { ServerSettingsType: __type(name: "ServerSettings") { ...fieldData } } fragment fieldData on __Type { fields { ...
python
wandb/sdk/internal/internal_api.py
482
506
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,289
server_use_artifact_input_introspection
def server_use_artifact_input_introspection(self) -> List: query_string = """ query ProbeServerUseArtifactInput { UseArtifactInputInfoType: __type(name: "UseArtifactInput") { name inputFields { name } ...
python
wandb/sdk/internal/internal_api.py
508
529
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,290
launch_agent_introspection
def launch_agent_introspection(self) -> Optional[str]: query = gql( """ query LaunchAgentIntrospection { LaunchAgentType: __type(name: "LaunchAgent") { name } } """ ) res = self.gql(query) re...
python
wandb/sdk/internal/internal_api.py
532
544
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,291
fail_run_queue_item_introspection
def fail_run_queue_item_introspection(self) -> bool: _, _, mutations = self.server_info_introspection() return "failRunQueueItem" in mutations
python
wandb/sdk/internal/internal_api.py
547
549
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,292
fail_run_queue_item
def fail_run_queue_item(self, run_queue_item_id: str) -> bool: mutation = gql( """ mutation failRunQueueItem($runQueueItemId: ID!) { failRunQueueItem( input: { runQueueItemId: $runQueueItemId } ) { su...
python
wandb/sdk/internal/internal_api.py
552
573
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,293
viewer
def viewer(self) -> Dict[str, Any]: query = gql( """ query Viewer{ viewer { id entity flags teams { edges { node { name ...
python
wandb/sdk/internal/internal_api.py
576
596
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,294
max_cli_version
def max_cli_version(self) -> Optional[str]: if self._max_cli_version is not None: return self._max_cli_version query_types, server_info_types, _ = self.server_info_introspection() cli_version_exists = ( "serverInfo" in query_types and "cliVersionInfo" in server_info_type...
python
wandb/sdk/internal/internal_api.py
599
614
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,295
viewer_server_info
def viewer_server_info(self) -> Tuple[Dict[str, Any], Dict[str, Any]]: local_query = """ latestLocalVersionInfo { outOfDate latestVersionString } """ cli_query = """ serverInfo { cliVersionInfo _L...
python
wandb/sdk/internal/internal_api.py
617
668
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,296
list_projects
def list_projects(self, entity: Optional[str] = None) -> List[Dict[str, str]]: """List projects in W&B scoped by entity. Arguments: entity (str, optional): The entity to scope this project to. Returns: [{"id","name","description"}] """ query = gql( ...
python
wandb/sdk/internal/internal_api.py
671
700
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,297
project
def project(self, project: str, entity: Optional[str] = None) -> "_Response": """Retrieve project. Arguments: project (str): The project to get details for entity (str, optional): The entity to scope this project to. Returns: [{"id","name","repo","docker...
python
wandb/sdk/internal/internal_api.py
703
729
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,298
sweep
def sweep( self, sweep: str, specs: str, project: Optional[str] = None, entity: Optional[str] = None, ) -> Dict[str, Any]: """Retrieve sweep. Arguments: sweep (str): The sweep to get details for specs (str): history specs p...
python
wandb/sdk/internal/internal_api.py
732
806
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,299
list_runs
def list_runs( self, project: str, entity: Optional[str] = None ) -> List[Dict[str, str]]: """List runs in W&B scoped by project. Arguments: project (str): The project to scope the runs to entity (str, optional): The entity to scope this project to. Defaults to publ...
python
wandb/sdk/internal/internal_api.py
809
847
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,300
run_config
def run_config( self, project: str, run: Optional[str] = None, entity: Optional[str] = None ) -> Tuple[str, Dict[str, Any], Optional[str], Dict[str, Any]]: """Get the relevant configs for a run. Arguments: project (str): The project to download, (can include bucket) ...
python
wandb/sdk/internal/internal_api.py
850
934
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }