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,401
handle_request_log_artifact
def handle_request_log_artifact(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
632
633
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,402
handle_request_artifact_send
def handle_request_artifact_send(self, record: Record) -> None: assert record.control.req_resp result = proto_util._result_from_record(record) self._dispatch_record(record) # send response immediately, the request will be polled for result xid = record.uuid result.respo...
python
wandb/sdk/internal/handler.py
635
644
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,403
handle_request_artifact_poll
def handle_request_artifact_poll(self, record: Record) -> None: assert record.control.req_resp xid = record.request.artifact_poll.xid assert xid result = proto_util._result_from_record(record) done_req = self._artifact_xid_done.get(xid) if done_req: result.re...
python
wandb/sdk/internal/handler.py
646
659
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,404
handle_request_artifact_done
def handle_request_artifact_done(self, record: Record) -> None: assert not record.control.req_resp done_req = record.request.artifact_done xid = done_req.xid assert xid self._artifact_xid_done[xid] = done_req
python
wandb/sdk/internal/handler.py
661
667
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,405
handle_telemetry
def handle_telemetry(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
673
674
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,406
handle_request_run_start
def handle_request_run_start(self, record: Record) -> None: run_start = record.request.run_start assert run_start assert run_start.run self._run_start_time = run_start.run.start_time.ToMicroseconds() / 1e6 self._track_time = time.time() if run_start.run.resumed and run_...
python
wandb/sdk/internal/handler.py
676
706
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,407
handle_request_resume
def handle_request_resume(self, record: Record) -> None: if self._system_monitor is not None: logger.info("starting system metrics thread or process") self._system_monitor.start() if self._track_time is not None: self._accumulate_time += time.time() - self._track_tim...
python
wandb/sdk/internal/handler.py
708
715
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,408
handle_request_pause
def handle_request_pause(self, record: Record) -> None: if self._system_monitor is not None: logger.info("stopping system metrics thread or process") self._system_monitor.finish() if self._track_time is not None: self._accumulate_time += time.time() - self._track_time...
python
wandb/sdk/internal/handler.py
717
723
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,409
handle_request_poll_exit
def handle_request_poll_exit(self, record: Record) -> None: self._dispatch_record(record, always_send=True)
python
wandb/sdk/internal/handler.py
725
726
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,410
handle_request_stop_status
def handle_request_stop_status(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
728
729
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,411
handle_request_network_status
def handle_request_network_status(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
731
732
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,412
handle_request_status
def handle_request_status(self, record: Record) -> None: # TODO(mempressure): do something better? assert record.control.req_resp result = proto_util._result_from_record(record) self._respond_result(result)
python
wandb/sdk/internal/handler.py
734
738
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,413
handle_request_get_summary
def handle_request_get_summary(self, record: Record) -> None: result = proto_util._result_from_record(record) for key, value in self._consolidated_summary.items(): item = SummaryItem() item.key = key item.value_json = json.dumps(value) result.response.get_...
python
wandb/sdk/internal/handler.py
740
747
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,414
handle_tbrecord
def handle_tbrecord(self, record: Record) -> None: logger.info("handling tbrecord: %s", record) if self._tb_watcher: tbrecord = record.tbrecord self._tb_watcher.add(tbrecord.log_dir, tbrecord.save, tbrecord.root_dir) self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
749
754
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,415
_handle_defined_metric
def _handle_defined_metric(self, record: Record) -> None: metric = record.metric if metric._control.overwrite: self._metric_defines[metric.name].CopyFrom(metric) else: self._metric_defines[metric.name].MergeFrom(metric) # before dispatching, make sure step_metric...
python
wandb/sdk/internal/handler.py
756
774
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,416
_handle_glob_metric
def _handle_glob_metric(self, record: Record) -> None: metric = record.metric if metric._control.overwrite: self._metric_globs[metric.glob_name].CopyFrom(metric) else: self._metric_globs[metric.glob_name].MergeFrom(metric) self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
776
782
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,417
handle_metric
def handle_metric(self, record: Record) -> None: """Handle MetricRecord. Walkthrough of the life of a MetricRecord: Metric defined: - run.define_metric() parses arguments create wandb_metric.Metric - build MetricRecord publish to interface - handler (this function) keep...
python
wandb/sdk/internal/handler.py
784
811
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,418
handle_request_sampled_history
def handle_request_sampled_history(self, record: Record) -> None: result = proto_util._result_from_record(record) for key, sampled in self._sampled_history.items(): item = SampledHistoryItem() item.key = key values: Iterable[Any] = sampled.get() if all(isi...
python
wandb/sdk/internal/handler.py
813
824
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,419
handle_request_server_info
def handle_request_server_info(self, record: Record) -> None: self._dispatch_record(record, always_send=True)
python
wandb/sdk/internal/handler.py
826
827
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,420
handle_request_keepalive
def handle_request_keepalive(self, record: Record) -> None: """Handle a keepalive request. Keepalive is a noop, we just want to verify transport is alive. """
python
wandb/sdk/internal/handler.py
829
833
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,421
handle_request_run_status
def handle_request_run_status(self, record: Record) -> None: self._dispatch_record(record, always_send=True)
python
wandb/sdk/internal/handler.py
835
836
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,422
handle_request_shutdown
def handle_request_shutdown(self, record: Record) -> None: # TODO(jhr): should we drain things and stop new requests from coming in? result = proto_util._result_from_record(record) self._respond_result(result) self._stopped.set()
python
wandb/sdk/internal/handler.py
838
842
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,423
finish
def finish(self) -> None: logger.info("shutting down handler") if self._system_monitor is not None: self._system_monitor.finish() if self._tb_watcher: self._tb_watcher.finish() # self._context_keeper._debug_print_orphans()
python
wandb/sdk/internal/handler.py
844
850
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,424
__next__
def __next__(self) -> Record: return self._record_q.get(block=True)
python
wandb/sdk/internal/handler.py
852
853
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,425
_history_assign_runtime
def _history_assign_runtime( self, history: HistoryRecord, history_dict: Dict[str, Any], ) -> None: # _runtime calculation is meaningless if there is no _timestamp if "_timestamp" not in history_dict: return # if it is offline sync, self._run_start_time is...
python
wandb/sdk/internal/handler.py
857
872
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,426
__init__
def __init__(self, d: "SettingsDict") -> None: object.__setattr__(self, "__dict__", d)
python
wandb/sdk/internal/settings_static.py
70
71
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,427
__setattr__
def __setattr__(self, name: str, value: object) -> None: raise AttributeError("Error: SettingsStatic is a readonly object")
python
wandb/sdk/internal/settings_static.py
73
74
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,428
__setitem__
def __setitem__(self, key: str, val: object) -> None: raise AttributeError("Error: SettingsStatic is a readonly object")
python
wandb/sdk/internal/settings_static.py
76
77
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,429
keys
def keys(self) -> "Iterable[str]": return self.__dict__.keys()
python
wandb/sdk/internal/settings_static.py
79
80
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,430
items
def items(self) -> "Iterable[Any]": return self.__dict__.items()
python
wandb/sdk/internal/settings_static.py
82
83
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,431
__getitem__
def __getitem__(self, key: str) -> "Any": return self.__dict__[key]
python
wandb/sdk/internal/settings_static.py
85
86
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,432
__str__
def __str__(self) -> str: return str(self.__dict__)
python
wandb/sdk/internal/settings_static.py
88
89
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,433
__contains__
def __contains__(self, key: str) -> bool: return key in self.__dict__
python
wandb/sdk/internal/settings_static.py
91
92
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,434
get
def get(self, key: str, default: Optional[Any] = None) -> Any: return self.__dict__.get(key, default)
python
wandb/sdk/internal/settings_static.py
94
95
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,435
_link_and_save_file
def _link_and_save_file( path: str, base_path: str, interface: "InterfaceQueue", settings: "SettingsStatic" ) -> None: # TODO(jhr): should this logic be merged with Run.save() files_dir = settings.files_dir file_name = os.path.relpath(path, base_path) abs_path = os.path.abspath(path) wandb_path ...
python
wandb/sdk/internal/tb_watcher.py
42
58
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,436
is_tfevents_file_created_by
def is_tfevents_file_created_by(path: str, hostname: str, start_time: float) -> bool: """Check if a path is a tfevents file created by hostname. tensorboard tfevents filename format: https://github.com/tensorflow/tensorboard/blob/f3f26b46981da5bd46a5bb93fcf02d9eb7608bc1/tensorboard/summary/writer/event...
python
wandb/sdk/internal/tb_watcher.py
61
96
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,437
__init__
def __init__( self, settings: "SettingsStatic", run_proto: "RunRecord", interface: "InterfaceQueue", force: bool = False, ) -> None: self._logdirs = {} self._consumer: Optional["TBEventConsumer"] = None self._settings = settings self._interface...
python
wandb/sdk/internal/tb_watcher.py
103
118
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,438
_calculate_namespace
def _calculate_namespace(self, logdir: str, rootdir: str) -> Optional[str]: namespace: Optional[str] dirs = list(self._logdirs) + [logdir] if os.path.isfile(logdir): filename = os.path.basename(logdir) else: filename = "" if rootdir == "": ro...
python
wandb/sdk/internal/tb_watcher.py
120
146
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,439
add
def add(self, logdir: str, save: bool, root_dir: str) -> None: logdir = util.to_forward_slash_path(logdir) root_dir = util.to_forward_slash_path(root_dir) if logdir in self._logdirs: return namespace = self._calculate_namespace(logdir, root_dir) # TODO(jhr): implement...
python
wandb/sdk/internal/tb_watcher.py
148
166
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,440
finish
def finish(self) -> None: for tbdirwatcher in self._logdirs.values(): tbdirwatcher.shutdown() for tbdirwatcher in self._logdirs.values(): tbdirwatcher.finish() if self._consumer: self._consumer.finish()
python
wandb/sdk/internal/tb_watcher.py
168
174
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,441
__init__
def __init__( self, tbwatcher: "TBWatcher", logdir: str, save: bool, namespace: Optional[str], queue: "PriorityQueue", force: bool = False, ) -> None: self.directory_watcher = util.get_module( "tensorboard.backend.event_processing.directory...
python
wandb/sdk/internal/tb_watcher.py
178
211
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,442
start
def start(self) -> None: self._thread.start()
python
wandb/sdk/internal/tb_watcher.py
213
214
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,443
_is_our_tfevents_file
def _is_our_tfevents_file(self, path: str) -> bool: """Check if a path has been modified since launch and contains tfevents.""" if not path: raise ValueError("Path must be a nonempty string") if self._force: return True path = self.tf_compat.tf.compat.as_str_any(p...
python
wandb/sdk/internal/tb_watcher.py
216
225
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,444
_loader
def _loader( self, save: bool = True, namespace: Optional[str] = None ) -> "EventFileLoader": """Incredibly hacky class generator to optionally save / prefix tfevent files.""" _loader_interface = self._tbwatcher._interface _loader_settings = self._tbwatcher._settings try: ...
python
wandb/sdk/internal/tb_watcher.py
227
260
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,445
__init__
def __init__(self, file_path: str) -> None: super().__init__(file_path) if save: if REMOTE_FILE_TOKEN in file_path: logger.warning( "Not persisting remote tfevent file: %s", file_path ) ...
python
wandb/sdk/internal/tb_watcher.py
239
258
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,446
_process_events
def _process_events(self, shutdown_call: bool = False) -> None: try: with self._process_events_lock: for event in self._generator.Load(): self.process_event(event) except ( self.directory_watcher.DirectoryDeletedError, StopIteration...
python
wandb/sdk/internal/tb_watcher.py
262
276
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,447
_thread_except_body
def _thread_except_body(self) -> None: try: self._thread_body() except Exception as e: logger.exception("generic exception in TBDirWatcher thread") raise e
python
wandb/sdk/internal/tb_watcher.py
278
283
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,448
_thread_body
def _thread_body(self) -> None: """Check for new events every second.""" shutdown_time: Optional[float] = None while True: self._process_events() if self._shutdown.is_set(): now = time.time() if not shutdown_time: shutdo...
python
wandb/sdk/internal/tb_watcher.py
285
296
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,449
process_event
def process_event(self, event: "ProtoEvent") -> None: # print("\nEVENT:::", self._logdir, self._namespace, event, "\n") if self._first_event_timestamp is None: self._first_event_timestamp = event.wall_time if event.HasField("file_version"): self._file_version = event.fil...
python
wandb/sdk/internal/tb_watcher.py
298
307
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,450
shutdown
def shutdown(self) -> None: self._process_events(shutdown_call=True) self._shutdown.set()
python
wandb/sdk/internal/tb_watcher.py
309
311
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,451
finish
def finish(self) -> None: self.shutdown() self._thread.join()
python
wandb/sdk/internal/tb_watcher.py
313
315
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,452
__init__
def __init__(self, event: "ProtoEvent", namespace: Optional[str]): self.event = event self.namespace = namespace self.created_at = time.time()
python
wandb/sdk/internal/tb_watcher.py
321
324
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,453
__lt__
def __lt__(self, other: "Event") -> bool: if self.event.wall_time < other.event.wall_time: return True return False
python
wandb/sdk/internal/tb_watcher.py
326
329
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,454
__init__
def __init__( self, tbwatcher: TBWatcher, queue: "PriorityQueue", run_proto: "RunRecord", settings: "SettingsStatic", delay: int = 10, ) -> None: self._tbwatcher = tbwatcher self._queue = queue self._thread = threading.Thread(target=self._threa...
python
wandb/sdk/internal/tb_watcher.py
340
364
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,455
datatypes_cb
def datatypes_cb(fname: GlobStr) -> None: files: "FilesDict" = dict(files=[(fname, "now")]) self._tbwatcher._interface.publish_files(files)
python
wandb/sdk/internal/tb_watcher.py
358
360
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,456
start
def start(self) -> None: self._start_time = time.time() self._thread.start()
python
wandb/sdk/internal/tb_watcher.py
366
368
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,457
finish
def finish(self) -> None: self._delay = 0 self._shutdown.set() self._thread.join() while not self._queue.empty(): event = self._queue.get(True, 1) if event: self._handle_event(event, history=self.tb_history) items = self.tb_history....
python
wandb/sdk/internal/tb_watcher.py
370
382
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,458
_thread_except_body
def _thread_except_body(self) -> None: try: self._thread_body() except Exception as e: logger.exception("generic exception in TBEventConsumer thread") raise e
python
wandb/sdk/internal/tb_watcher.py
384
389
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,459
_thread_body
def _thread_body(self) -> None: while True: try: event = self._queue.get(True, 1) # Wait self._delay seconds from consumer start before logging events if ( time.time() < self._start_time + self._delay and not sel...
python
wandb/sdk/internal/tb_watcher.py
391
418
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,460
_handle_event
def _handle_event( self, event: "ProtoEvent", history: Optional["TBHistory"] = None ) -> None: wandb.tensorboard._log( event.event, step=event.event.step, namespace=event.namespace, history=history, )
python
wandb/sdk/internal/tb_watcher.py
420
428
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,461
_save_row
def _save_row(self, row: "HistoryDict") -> None: chart_keys = set() for k in row: if isinstance(row[k], CustomChart): chart_keys.add(k) key = row[k].get_config_key(k) value = row[k].get_config_value( "Vega2", row[k].user_que...
python
wandb/sdk/internal/tb_watcher.py
430
447
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,462
__init__
def __init__(self) -> None: self._step = 0 self._step_size = 0 self._data = dict() self._added = []
python
wandb/sdk/internal/tb_watcher.py
454
458
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,463
_flush
def _flush(self) -> None: if not self._data: return # A single tensorboard step may have too much data # we just drop the largest keys in the step if it does. # TODO: we could flush the data across multiple steps if self._step_size > util.MAX_LINE_BYTES: m...
python
wandb/sdk/internal/tb_watcher.py
460
488
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,464
add
def add(self, d: "HistoryDict") -> None: self._flush() self._data = dict() self._data.update(self._track_history_dict(d))
python
wandb/sdk/internal/tb_watcher.py
490
493
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,465
_track_history_dict
def _track_history_dict(self, d: "HistoryDict") -> "HistoryDict": e = {} for k in d.keys(): e[k] = d[k] self._step_size += sys.getsizeof(e[k]) return e
python
wandb/sdk/internal/tb_watcher.py
495
500
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,466
_row_update
def _row_update(self, d: "HistoryDict") -> None: self._data.update(self._track_history_dict(d))
python
wandb/sdk/internal/tb_watcher.py
502
503
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,467
_get_and_reset
def _get_and_reset(self) -> "List[HistoryDict]": added = self._added[:] self._added = [] return added
python
wandb/sdk/internal/tb_watcher.py
505
508
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,468
_get_request_type
def _get_request_type(record: "Record") -> Optional[str]: record_type = record.WhichOneof("record_type") if record_type != "request": return None request_type = record.request.WhichOneof("request_type") return request_type
python
wandb/sdk/internal/flow_control.py
48
53
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,469
_is_control_record
def _is_control_record(record: "Record") -> bool: return record.control.flow_control
python
wandb/sdk/internal/flow_control.py
56
57
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,470
_is_local_non_control_record
def _is_local_non_control_record(record: "Record") -> bool: return record.control.local and not record.control.flow_control
python
wandb/sdk/internal/flow_control.py
60
61
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,471
__init__
def __init__( self, settings: SettingsStatic, forward_record: Callable[["Record"], None], write_record: Callable[["Record"], int], pause_marker: Callable[[], None], recover_records: Callable[[int, int], None], _threshold_bytes_high: int = 0, _threshold_byt...
python
wandb/sdk/internal/flow_control.py
74
138
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,472
flush
def flush(self) -> None: # TODO(mempressure): what do we do here, how do we make sure we dont have work in pause state pass
python
wandb/sdk/internal/flow_control.py
140
142
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,473
flow
def flow(self, record: "Record") -> None: self._fsm.input(record)
python
wandb/sdk/internal/flow_control.py
144
145
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,474
__init__
def __init__(self) -> None: self._context = StateContext()
python
wandb/sdk/internal/flow_control.py
151
152
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,475
_update_written_offset
def _update_written_offset(self, record: "Record") -> None: end_offset = record.control.end_offset if end_offset: self._context.last_written_offset = end_offset
python
wandb/sdk/internal/flow_control.py
154
157
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,476
_update_forwarded_offset
def _update_forwarded_offset(self) -> None: self._context.last_forwarded_offset = self._context.last_written_offset
python
wandb/sdk/internal/flow_control.py
159
160
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,477
_process
def _process(self, record: "Record") -> None: request_type = _get_request_type(record) if not request_type: return process_str = f"_process_{request_type}" process_handler: Optional[Callable[["pb.Record"], None]] = getattr( self, process_str, None ) ...
python
wandb/sdk/internal/flow_control.py
162
172
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,478
_process_status_report
def _process_status_report(self, record: "Record") -> None: sent_offset = record.request.status_report.sent_offset self._context.last_sent_offset = sent_offset
python
wandb/sdk/internal/flow_control.py
174
176
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,479
on_exit
def on_exit(self, record: "Record") -> StateContext: return self._context
python
wandb/sdk/internal/flow_control.py
178
179
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,480
on_enter
def on_enter(self, record: "Record", context: StateContext) -> None: self._context = context
python
wandb/sdk/internal/flow_control.py
181
182
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,481
_behind_bytes
def _behind_bytes(self) -> int: return self._context.last_forwarded_offset - self._context.last_sent_offset
python
wandb/sdk/internal/flow_control.py
185
186
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,482
__init__
def __init__( self, forward_record: Callable[["Record"], None], pause_marker: Callable[[], None], threshold_pause: int, ) -> None: super().__init__() self._forward_record = forward_record self._pause_marker = pause_marker self._threshold_pause = thresh...
python
wandb/sdk/internal/flow_control.py
194
203
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,483
_should_pause
def _should_pause(self, record: "Record") -> bool: return self._behind_bytes >= self._threshold_pause
python
wandb/sdk/internal/flow_control.py
205
206
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,484
_pause
def _pause(self, record: "Record") -> None: self._pause_marker()
python
wandb/sdk/internal/flow_control.py
208
209
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,485
on_check
def on_check(self, record: "Record") -> None: self._update_written_offset(record) self._process(record) if not _is_control_record(record): self._forward_record(record) self._update_forwarded_offset()
python
wandb/sdk/internal/flow_control.py
211
216
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,486
__init__
def __init__( self, forward_record: Callable[["Record"], None], recover_records: Callable[[int, int], None], threshold_recover: int, threshold_forward: int, ) -> None: super().__init__() self._forward_record = forward_record self._recover_records = rec...
python
wandb/sdk/internal/flow_control.py
225
236
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,487
_should_unpause
def _should_unpause(self, record: "Record") -> bool: return self._behind_bytes < self._threshold_forward
python
wandb/sdk/internal/flow_control.py
238
239
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,488
_unpause
def _unpause(self, record: "Record") -> None: self._quiesce(record)
python
wandb/sdk/internal/flow_control.py
241
242
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,489
_should_recover
def _should_recover(self, record: "Record") -> bool: return self._behind_bytes < self._threshold_recover
python
wandb/sdk/internal/flow_control.py
244
245
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,490
_recover
def _recover(self, record: "Record") -> None: self._quiesce(record)
python
wandb/sdk/internal/flow_control.py
247
248
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,491
_should_quiesce
def _should_quiesce(self, record: "Record") -> bool: return _is_local_non_control_record(record)
python
wandb/sdk/internal/flow_control.py
250
251
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,492
_quiesce
def _quiesce(self, record: "Record") -> None: start = self._context.last_forwarded_offset end = self._context.last_written_offset if start != end: self._recover_records(start, end) if _is_local_non_control_record(record): self._forward_record(record) self....
python
wandb/sdk/internal/flow_control.py
253
260
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,493
on_check
def on_check(self, record: "Record") -> None: self._update_written_offset(record) self._process(record)
python
wandb/sdk/internal/flow_control.py
262
264
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,494
__init__
def __init__(self) -> None: self._cancel_event = threading.Event() # TODO(debug_context) see above # self._debug_record = None
python
wandb/sdk/internal/context.py
17
20
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,495
cancel
def cancel(self) -> None: self._cancel_event.set()
python
wandb/sdk/internal/context.py
22
23
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,496
cancel_event
def cancel_event(self) -> threading.Event: return self._cancel_event
python
wandb/sdk/internal/context.py
26
27
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,497
context_id_from_record
def context_id_from_record(record: Record) -> str: context_id = record.control.mailbox_slot return context_id
python
wandb/sdk/internal/context.py
30
32
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,498
context_id_from_result
def context_id_from_result(result: Result) -> str: context_id = result.control.mailbox_slot return context_id
python
wandb/sdk/internal/context.py
35
37
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,499
__init__
def __init__(self) -> None: self._active_items = {}
python
wandb/sdk/internal/context.py
43
44
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,500
add_from_record
def add_from_record(self, record: Record) -> Optional[Context]: context_id = context_id_from_record(record) if not context_id: return None context_obj = self.add(context_id) # TODO(debug_context) see above # context_obj._debug_record = record return context_...
python
wandb/sdk/internal/context.py
46
55
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }