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,501
_communicate_sampled_history
def _communicate_sampled_history( self, sampled_history: pb.SampledHistoryRequest ) -> Optional[pb.SampledHistoryResponse]: record = self._make_request(sampled_history=sampled_history) result = self._communicate(record) if result is None: return None sampled_histo...
python
wandb/sdk/interface/interface_shared.py
536
545
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,502
_communicate_shutdown
def _communicate_shutdown(self) -> None: # shutdown request = pb.Request(shutdown=pb.ShutdownRequest()) record = self._make_record(request=request) _ = self._communicate(record)
python
wandb/sdk/interface/interface_shared.py
547
551
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,503
_get_mailbox
def _get_mailbox(self) -> Mailbox: mailbox = self._mailbox assert mailbox return mailbox
python
wandb/sdk/interface/interface_shared.py
553
556
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,504
_deliver_record
def _deliver_record(self, record: pb.Record) -> MailboxHandle: mailbox = self._get_mailbox() handle = mailbox._deliver_record(record, interface=self) return handle
python
wandb/sdk/interface/interface_shared.py
558
561
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,505
_deliver_run
def _deliver_run(self, run: pb.RunRecord) -> MailboxHandle: record = self._make_record(run=run) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
563
565
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,506
_deliver_run_start
def _deliver_run_start(self, run_start: pb.RunStartRequest) -> MailboxHandle: record = self._make_request(run_start=run_start) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
567
569
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,507
_deliver_get_summary
def _deliver_get_summary(self, get_summary: pb.GetSummaryRequest) -> MailboxHandle: record = self._make_request(get_summary=get_summary) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
571
573
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,508
_deliver_exit
def _deliver_exit(self, exit_data: pb.RunExitRecord) -> MailboxHandle: record = self._make_record(exit=exit_data) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
575
577
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,509
_deliver_poll_exit
def _deliver_poll_exit(self, poll_exit: pb.PollExitRequest) -> MailboxHandle: record = self._make_request(poll_exit=poll_exit) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
579
581
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,510
_deliver_stop_status
def _deliver_stop_status(self, stop_status: pb.StopStatusRequest) -> MailboxHandle: record = self._make_request(stop_status=stop_status) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
583
585
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,511
_deliver_attach
def _deliver_attach(self, attach: pb.AttachRequest) -> MailboxHandle: record = self._make_request(attach=attach) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
587
589
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,512
_deliver_check_version
def _deliver_check_version( self, check_version: pb.CheckVersionRequest ) -> MailboxHandle: record = self._make_request(check_version=check_version) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
591
595
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,513
_deliver_network_status
def _deliver_network_status( self, network_status: pb.NetworkStatusRequest ) -> MailboxHandle: record = self._make_request(network_status=network_status) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
597
601
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,514
_deliver_request_server_info
def _deliver_request_server_info( self, server_info: pb.ServerInfoRequest ) -> MailboxHandle: record = self._make_request(server_info=server_info) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
603
607
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,515
_deliver_request_sampled_history
def _deliver_request_sampled_history( self, sampled_history: pb.SampledHistoryRequest ) -> MailboxHandle: record = self._make_request(sampled_history=sampled_history) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
609
613
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,516
_deliver_request_run_status
def _deliver_request_run_status( self, run_status: pb.RunStatusRequest ) -> MailboxHandle: record = self._make_request(run_status=run_status) return self._deliver_record(record)
python
wandb/sdk/interface/interface_shared.py
615
619
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,517
_transport_keepalive_failed
def _transport_keepalive_failed(self, keepalive_interval: int = 5) -> bool: if self._transport_failed: return True now = time.monotonic() if now < self._transport_success_timestamp + keepalive_interval: return False try: self.publish_keepalive() ...
python
wandb/sdk/interface/interface_shared.py
621
635
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,518
join
def join(self) -> None: super().join() if self._router: self._router.join()
python
wandb/sdk/interface/interface_shared.py
637
641
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,519
__init__
def __init__( self, record_q: Optional["Queue[pb.Record]"] = None, result_q: Optional["Queue[pb.Result]"] = None, process: Optional[BaseProcess] = None, process_check: bool = True, mailbox: Optional[Mailbox] = None, ) -> None: self.record_q = record_q ...
python
wandb/sdk/interface/interface_queue.py
30
44
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,520
_init_router
def _init_router(self) -> None: if self.record_q and self.result_q: self._router = MessageQueueRouter( self.record_q, self.result_q, mailbox=self._mailbox )
python
wandb/sdk/interface/interface_queue.py
46
50
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,521
_publish
def _publish(self, record: "pb.Record", local: Optional[bool] = None) -> None: if self._process_check and self._process and not self._process.is_alive(): raise Exception("The wandb backend process has shutdown") if local: record.control.local = local if self.record_q: ...
python
wandb/sdk/interface/interface_queue.py
52
59
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,522
__init__
def __init__( self, request_queue: "Queue[pb.Record]", response_queue: "Queue[pb.Result]", relay_queue: "Queue[pb.Result]", mailbox: Mailbox, ) -> None: self._relay_queue = relay_queue super().__init__( request_queue=request_queue, response_queue=r...
python
wandb/sdk/interface/router_relay.py
22
32
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,523
_handle_msg_rcv
def _handle_msg_rcv(self, msg: "pb.Result") -> None: if msg.control.relay_id: tracelog.log_message_queue(msg, self._relay_queue) self._relay_queue.put(msg) return super()._handle_msg_rcv(msg)
python
wandb/sdk/interface/router_relay.py
34
39
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,524
__init__
def __init__(self) -> None: self._object = None self._object_ready = threading.Event()
python
wandb/sdk/interface/message_future.py
17
19
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,525
_set_object
def _set_object(self, obj: pb.Result) -> None: self._object = obj self._object_ready.set()
python
wandb/sdk/interface/message_future.py
21
23
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,526
get
def get(self, timeout: Optional[int] = None) -> Optional[pb.Result]: raise NotImplementedError
python
wandb/sdk/interface/message_future.py
26
27
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,527
__init__
def __init__(self) -> None: super().__init__()
python
wandb/sdk/interface/router.py
32
33
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,528
get
def get(self, timeout: Optional[int] = None) -> Optional["pb.Result"]: is_set = self._object_ready.wait(timeout) if is_set and self._object: return self._object return None
python
wandb/sdk/interface/router.py
35
39
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,529
__init__
def __init__(self, mailbox: Optional[mailbox.Mailbox] = None) -> None: self._mailbox = mailbox self._pending_reqs = {} self._lock = threading.Lock() self._join_event = threading.Event() self._thread = threading.Thread(target=self.message_loop) self._thread.name = "MsgRou...
python
wandb/sdk/interface/router.py
48
57
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,530
_read_message
def _read_message(self) -> Optional["pb.Result"]: raise NotImplementedError
python
wandb/sdk/interface/router.py
60
61
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,531
_send_message
def _send_message(self, record: "pb.Record") -> None: raise NotImplementedError
python
wandb/sdk/interface/router.py
64
65
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,532
message_loop
def message_loop(self) -> None: while not self._join_event.is_set(): try: msg = self._read_message() except EOFError: # On abnormal shutdown the queue will be destroyed underneath # resulting in EOFError. message_loop needs to exit.. ...
python
wandb/sdk/interface/router.py
67
81
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,533
send_and_receive
def send_and_receive( self, rec: "pb.Record", local: Optional[bool] = None ) -> MessageFuture: rec.control.req_resp = True if local: rec.control.local = local rec.uuid = uuid.uuid4().hex future = MessageFutureObject() with self._lock: self._pen...
python
wandb/sdk/interface/router.py
83
96
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,534
join
def join(self) -> None: self._join_event.set() self._thread.join()
python
wandb/sdk/interface/router.py
98
100
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,535
_handle_msg_rcv
def _handle_msg_rcv(self, msg: "pb.Result") -> None: # deliver mailbox addressed messages to mailbox if self._mailbox and msg.control.mailbox_slot: self._mailbox.deliver(msg) return with self._lock: future = self._pending_reqs.pop(msg.uuid, None) if fu...
python
wandb/sdk/interface/router.py
102
118
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,536
__init__
def __init__(self, sock_client: SockClient, mailbox: Mailbox) -> None: # _sock_client is used when abstract method _init_router() is called by constructor self._sock_client = sock_client super().__init__(mailbox=mailbox) self._process_check = False self._stream_id = None
python
wandb/sdk/interface/interface_sock.py
30
35
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,537
_init_router
def _init_router(self) -> None: self._router = MessageSockRouter(self._sock_client, mailbox=self._mailbox)
python
wandb/sdk/interface/interface_sock.py
37
38
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,538
_hack_set_run
def _hack_set_run(self, run: "Run") -> None: super()._hack_set_run(run) assert run._run_id self._stream_id = run._run_id
python
wandb/sdk/interface/interface_sock.py
40
43
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,539
_assign
def _assign(self, record: Any) -> None: assert self._stream_id record._info.stream_id = self._stream_id
python
wandb/sdk/interface/interface_sock.py
45
47
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,540
_publish
def _publish(self, record: "pb.Record", local: Optional[bool] = None) -> None: self._assign(record) self._sock_client.send_record_publish(record)
python
wandb/sdk/interface/interface_sock.py
49
51
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,541
_communicate_async
def _communicate_async( self, rec: "pb.Record", local: Optional[bool] = None ) -> MessageFuture: self._assign(rec) assert self._router if self._process_check and self._process and not self._process.is_alive(): raise Exception("The wandb backend process has shutdown") ...
python
wandb/sdk/interface/interface_sock.py
53
61
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,542
_communicate_stop_status
def _communicate_stop_status( self, status: "pb.StopStatusRequest" ) -> Optional["pb.StopStatusResponse"]: # Message stop_status is called from a daemon thread started by wandb_run # The underlying socket might go away while the thread is still running. # Handle this like a timed-out...
python
wandb/sdk/interface/interface_sock.py
63
74
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,543
_communicate_network_status
def _communicate_network_status( self, status: "pb.NetworkStatusRequest" ) -> Optional["pb.NetworkStatusResponse"]: # Message network_status is called from a daemon thread started by wandb_run # The underlying socket might go away while the thread is still running. # Handle this like...
python
wandb/sdk/interface/interface_sock.py
76
87
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,544
__init__
def __init__( self, artifact: Optional["Artifact"] = None, attr: Optional[str] = None, msg: str = "Artifact is in an invalid state for the requested operation.", ): object_name = artifact.__class__.__name__ if artifact else "Artifact" method_id = f"{object_name}.{attr...
python
wandb/sdk/interface/artifacts/artifact.py
15
26
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,545
__init__
def __init__( self, artifact: Optional["Artifact"] = None, attr: Optional[str] = None ): super().__init__( artifact, attr, "'{method_id}' used prior to logging artifact or while in offline mode. " "Call wait() before accessing logged artifact propertie...
python
wandb/sdk/interface/artifacts/artifact.py
32
40
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,546
__init__
def __init__( self, artifact: Optional["Artifact"] = None, attr: Optional[str] = None ): super().__init__( artifact, attr, "'{method_id}' used on logged artifact. Can't add to finalized artifact.", )
python
wandb/sdk/interface/artifacts/artifact.py
46
53
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,547
id
def id(self) -> Optional[str]: """The artifact's ID.""" raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
58
60
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,548
version
def version(self) -> str: """The version of this artifact. For example, if this is the first version of an artifact, its `version` will be 'v0'. """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
63
69
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,549
source_version
def source_version(self) -> Optional[str]: """The artifact's version index under its parent artifact collection. A string with the format "v{number}". """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
72
77
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,550
name
def name(self) -> str: """The artifact's name.""" raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
80
82
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,551
type
def type(self) -> str: """The artifact's type.""" raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
85
87
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,552
entity
def entity(self) -> str: """The name of the entity this artifact belongs to.""" raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
90
92
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,553
project
def project(self) -> str: """The name of the project this artifact belongs to.""" raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
95
97
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,554
manifest
def manifest(self) -> "ArtifactManifest": """The artifact's manifest. The manifest lists all of its contents, and can't be changed once the artifact has been logged. """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
100
106
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,555
digest
def digest(self) -> str: """The logical digest of the artifact. The digest is the checksum of the artifact's contents. If an artifact has the same digest as the current `latest` version, then `log_artifact` is a no-op. """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
109
115
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,556
state
def state(self) -> str: """The status of the artifact. One of: "PENDING", "COMMITTED", or "DELETED".""" raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
118
120
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,557
size
def size(self) -> int: """The total size of the artifact in bytes. Returns: (int): The size in bytes of the artifact. Includes any references tracked by this artifact. """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
123
130
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,558
commit_hash
def commit_hash(self) -> str: """The hash returned when this artifact was committed. Returns: (str): The artifact's commit hash which is used in http URLs. """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
133
139
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,559
description
def description(self) -> Optional[str]: """The artifact description. Returns: (str): Free text that offers a user-set description of the artifact. """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
142
148
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,560
description
def description(self, desc: Optional[str]) -> None: """Set the description of the artifact. The description is markdown rendered in the UI, so this is a good place to put links, etc. Arguments: desc: Free text that offers a description of the artifact. """ r...
python
wandb/sdk/interface/artifacts/artifact.py
151
160
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,561
metadata
def metadata(self) -> dict: """User-defined artifact metadata. Returns: (dict): Structured data associated with the artifact. """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
163
169
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,562
metadata
def metadata(self, metadata: dict) -> None: """User-defined artifact metadata. Metadata set this way will eventually be queryable and plottable in the UI; e.g. the class distribution of a dataset. Note: There is currently a limit of 100 total keys. Arguments: metad...
python
wandb/sdk/interface/artifacts/artifact.py
172
183
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,563
aliases
def aliases(self) -> List[str]: """The aliases associated with this artifact. The list is mutable and calling `save()` will persist all alias changes. """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
186
191
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,564
aliases
def aliases(self, aliases: List[str]) -> None: """Set the aliases associated with this artifact.""" raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
194
196
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,565
used_by
def used_by(self) -> List["wandb.apis.public.Run"]: """Get a list of the runs that have used this artifact.""" raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
198
200
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,566
logged_by
def logged_by(self) -> "wandb.apis.public.Run": """Get the run that first logged this artifact.""" raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
202
204
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,567
new_file
def new_file( self, name: str, mode: str = "w", encoding: Optional[str] = None ) -> ContextManager[IO]: """Open a new temporary file that will be automatically added to the artifact. Arguments: name: (str) The name of the new file being added to the artifact. mode: (...
python
wandb/sdk/interface/artifacts/artifact.py
206
231
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,568
add_file
def add_file( self, local_path: str, name: Optional[str] = None, is_tmp: Optional[bool] = False, ) -> "ArtifactManifestEntry": """Add a local file to the artifact. Arguments: local_path: (str) The path to the file being added. name: (str, opti...
python
wandb/sdk/interface/artifacts/artifact.py
233
268
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,569
add_dir
def add_dir(self, local_path: str, name: Optional[str] = None) -> None: """Add a local directory to the artifact. Arguments: local_path: (str) The path to the directory being added. name: (str, optional) The path within the artifact to use for the directory being...
python
wandb/sdk/interface/artifacts/artifact.py
270
297
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,570
add_reference
def add_reference( self, uri: Union["ArtifactManifestEntry", str], name: Optional[str] = None, checksum: bool = True, max_objects: Optional[int] = None, ) -> Sequence["ArtifactManifestEntry"]: """Add a reference denoted by a URI to the artifact. Unlike adding...
python
wandb/sdk/interface/artifacts/artifact.py
299
368
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,571
add
def add(self, obj: WBValue, name: str) -> "ArtifactManifestEntry": """Add wandb.WBValue `obj` to the artifact. ``` obj = artifact.get(name) ``` Arguments: obj: (wandb.WBValue) The object to add. Currently support one of Bokeh, JoinedTable, Partitione...
python
wandb/sdk/interface/artifacts/artifact.py
370
405
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,572
get_path
def get_path(self, name: str) -> "ArtifactManifestEntry": """Get the path to the file located at the artifact relative `name`. Arguments: name: (str) The artifact relative name to get Raises: ArtifactNotLoggedError: if the artifact isn't logged or the run is offline ...
python
wandb/sdk/interface/artifacts/artifact.py
407
434
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,573
get
def get(self, name: str) -> WBValue: """Get the WBValue object located at the artifact relative `name`. Arguments: name: (str) The artifact relative name to get Raises: ArtifactNotLoggedError: if the artifact isn't logged or the run is offline Examples: ...
python
wandb/sdk/interface/artifacts/artifact.py
436
461
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,574
download
def download( self, root: Optional[str] = None, recursive: bool = False ) -> FilePathStr: """Download the contents of the artifact to the specified root directory. NOTE: Any existing files at `root` are left untouched. Explicitly delete root before calling `download` if you want the...
python
wandb/sdk/interface/artifacts/artifact.py
463
480
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,575
checkout
def checkout(self, root: Optional[str] = None) -> str: """Replace the specified root directory with the contents of the artifact. WARNING: This will DELETE all files in `root` that are not included in the artifact. Arguments: root: (str, optional) The directory to replace w...
python
wandb/sdk/interface/artifacts/artifact.py
482
494
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,576
verify
def verify(self, root: Optional[str] = None) -> bool: """Verify that the actual contents of an artifact match the manifest. All files in the directory are checksummed and the checksums are then cross-referenced against the artifact's manifest. NOTE: References are not verified. ...
python
wandb/sdk/interface/artifacts/artifact.py
496
511
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,577
save
def save(self) -> None: """Persist any changes made to the artifact. Returns: None """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
513
519
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,578
link
def link(self, target_path: str, aliases: Optional[List[str]] = None) -> None: """Link this artifact to a portfolio (a promoted collection of artifacts), with aliases. Arguments: target_path: (str) The path to the portfolio. It must take the form {portfolio}, {project}/{port...
python
wandb/sdk/interface/artifacts/artifact.py
521
533
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,579
delete
def delete(self) -> None: """Delete this artifact, cleaning up all files associated with it. NOTE: Deletion is permanent and CANNOT be undone. Returns: None """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
535
543
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,580
wait
def wait(self) -> "Artifact": """Wait for this artifact to finish logging, if needed. Returns: Artifact """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact.py
545
551
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,581
__getitem__
def __getitem__(self, name: str) -> Optional[WBValue]: """Get the WBValue object located at the artifact relative `name`. Arguments: name: (str) The artifact relative name to get Raises: ArtifactNotLoggedError: if the artifact isn't logged or the run is offline ...
python
wandb/sdk/interface/artifacts/artifact.py
553
578
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,582
__setitem__
def __setitem__(self, name: str, item: WBValue) -> "ArtifactManifestEntry": """Add `item` to the artifact at path `name`. Arguments: name: (str) The path within the artifact to add the object. item: (wandb.WBValue) The object to add. Returns: ArtifactManifes...
python
wandb/sdk/interface/artifacts/artifact.py
580
609
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,583
__call__
def __call__(self, mode: str = ...) -> ContextManager[IO]: pass
python
wandb/sdk/interface/artifacts/artifact_cache.py
24
25
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,584
__init__
def __init__(self, cache_dir: StrPath) -> None: self._cache_dir = cache_dir mkdir_exists_ok(self._cache_dir) self._md5_obj_dir = os.path.join(self._cache_dir, "obj", "md5") self._etag_obj_dir = os.path.join(self._cache_dir, "obj", "etag") self._artifacts_by_id: Dict[str, Artifact...
python
wandb/sdk/interface/artifacts/artifact_cache.py
31
37
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,585
check_md5_obj_path
def check_md5_obj_path( self, b64_md5: B64MD5, size: int ) -> Tuple[FilePathStr, bool, "Opener"]: hex_md5 = b64_to_hex_id(b64_md5) path = os.path.join(self._cache_dir, "obj", "md5", hex_md5[:2], hex_md5[2:]) opener = self._cache_opener(path) if os.path.isfile(path) and os.pat...
python
wandb/sdk/interface/artifacts/artifact_cache.py
39
48
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,586
check_etag_obj_path
def check_etag_obj_path( self, url: URIStr, etag: ETag, size: int, ) -> Tuple[FilePathStr, bool, "Opener"]: hexhash = hashlib.sha256( hashlib.sha256(url.encode("utf-8")).digest() + hashlib.sha256(etag.encode("utf-8")).digest() ).hexdigest() ...
python
wandb/sdk/interface/artifacts/artifact_cache.py
52
67
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,587
get_artifact
def get_artifact(self, artifact_id: str) -> Optional["Artifact"]: return self._artifacts_by_id.get(artifact_id)
python
wandb/sdk/interface/artifacts/artifact_cache.py
69
70
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,588
store_artifact
def store_artifact(self, artifact: "Artifact") -> None: if not artifact.id: raise ArtifactNotLoggedError(artifact, "store_artifact") self._artifacts_by_id[artifact.id] = artifact
python
wandb/sdk/interface/artifacts/artifact_cache.py
72
75
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,589
get_client_artifact
def get_client_artifact( self, client_id: str ) -> Optional["wandb_artifacts.Artifact"]: return self._artifacts_by_client_id.get(client_id)
python
wandb/sdk/interface/artifacts/artifact_cache.py
77
80
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,590
store_client_artifact
def store_client_artifact(self, artifact: "wandb_artifacts.Artifact") -> None: self._artifacts_by_client_id[artifact._client_id] = artifact
python
wandb/sdk/interface/artifacts/artifact_cache.py
82
83
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,591
cleanup
def cleanup(self, target_size: int) -> int: bytes_reclaimed = 0 paths = {} total_size = 0 for root, _, files in os.walk(self._cache_dir): for file in files: try: path = str(os.path.join(root, file)) stat = os.stat(path) ...
python
wandb/sdk/interface/artifacts/artifact_cache.py
85
116
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,592
_cache_opener
def _cache_opener(self, path: StrPath) -> "Opener": @contextlib.contextmanager def helper(mode: str = "w") -> Generator[IO, None, None]: if "a" in mode: raise ValueError("Appending to cache files is not supported") dirname = os.path.dirname(path) tmp_...
python
wandb/sdk/interface/artifacts/artifact_cache.py
118
152
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,593
helper
def helper(mode: str = "w") -> Generator[IO, None, None]: if "a" in mode: raise ValueError("Appending to cache files is not supported") dirname = os.path.dirname(path) tmp_file = os.path.join( dirname, f"{ArtifactsCache._TMP_PREFIX}_{secrets.token_hex...
python
wandb/sdk/interface/artifacts/artifact_cache.py
120
150
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,594
get_artifacts_cache
def get_artifacts_cache() -> ArtifactsCache: global _artifacts_cache if _artifacts_cache is None: cache_dir = os.path.join(env.get_cache_dir(), "artifacts") _artifacts_cache = ArtifactsCache(cache_dir) return _artifacts_cache
python
wandb/sdk/interface/artifacts/artifact_cache.py
158
163
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,595
__post_init__
def __post_init__(self) -> None: self.path = util.to_forward_slash_path(self.path) self.extra = self.extra or {} if self.local_path and self.size is None: raise ValueError("size required when local_path specified")
python
wandb/sdk/interface/artifacts/artifact_manifest.py
23
27
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,596
parent_artifact
def parent_artifact(self) -> "Artifact": """Get the artifact to which this artifact entry belongs. Returns: (Artifact): The parent artifact """ raise NotImplementedError
python
wandb/sdk/interface/artifacts/artifact_manifest.py
29
35
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,597
download
def download(self, root: Optional[str] = None) -> FilePathStr: """Download this artifact entry to the specified root path. Arguments: root: (str, optional) The root path in which to download this artifact entry. Defaults to the artifact's root. Returns: ...
python
wandb/sdk/interface/artifacts/artifact_manifest.py
37
48
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,598
ref_target
def ref_target(self) -> str: """Get the reference URL that is targeted by this artifact entry. Returns: (str): The reference URL of this artifact entry. Raises: ValueError: If this artifact entry was not a reference. """ if self.ref is None: ...
python
wandb/sdk/interface/artifacts/artifact_manifest.py
50
61
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,599
ref_url
def ref_url(self) -> str: """Get a URL to this artifact entry. These URLs can be referenced by another artifact. Returns: (str): A URL representing this artifact entry. Examples: Basic usage ``` ref_url = source_artifact.get_path('file.t...
python
wandb/sdk/interface/artifacts/artifact_manifest.py
63
78
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
3,600
from_manifest_json
def from_manifest_json(cls, manifest_json: Dict) -> "ArtifactManifest": if "version" not in manifest_json: raise ValueError("Invalid manifest format. Must contain version field.") version = manifest_json["version"] for sub in cls.__subclasses__(): if sub.version() == vers...
python
wandb/sdk/interface/artifacts/artifact_manifest.py
85
92
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }