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 |
|---|---|---|---|---|---|---|---|
2,901 | commit_hash | def commit_hash(self) -> str:
return self._instance.commit_hash | python | wandb/sdk/wandb_run.py | 3,815 | 3,816 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,902 | description | def description(self) -> Optional[str]:
return self._instance.description | python | wandb/sdk/wandb_run.py | 3,819 | 3,820 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,903 | description | def description(self, desc: Optional[str]) -> None:
self._instance.description = desc | python | wandb/sdk/wandb_run.py | 3,823 | 3,824 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,904 | metadata | def metadata(self) -> dict:
return self._instance.metadata | python | wandb/sdk/wandb_run.py | 3,827 | 3,828 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,905 | metadata | def metadata(self, metadata: dict) -> None:
self._instance.metadata = metadata | python | wandb/sdk/wandb_run.py | 3,831 | 3,832 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,906 | aliases | def aliases(self) -> List[str]:
return self._instance.aliases | python | wandb/sdk/wandb_run.py | 3,835 | 3,836 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,907 | aliases | def aliases(self, aliases: List[str]) -> None:
self._instance.aliases = aliases | python | wandb/sdk/wandb_run.py | 3,839 | 3,840 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,908 | used_by | def used_by(self) -> List["wandb.apis.public.Run"]:
return self._instance.used_by() | python | wandb/sdk/wandb_run.py | 3,842 | 3,843 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,909 | logged_by | def logged_by(self) -> "wandb.apis.public.Run":
return self._instance.logged_by() | python | wandb/sdk/wandb_run.py | 3,845 | 3,846 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,910 | get_path | def get_path(self, name: str) -> "ArtifactManifestEntry":
return self._instance.get_path(name) | python | wandb/sdk/wandb_run.py | 3,848 | 3,849 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,911 | get | def get(self, name: str) -> "WBValue":
return self._instance.get(name) | python | wandb/sdk/wandb_run.py | 3,851 | 3,852 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,912 | download | def download(
self, root: Optional[str] = None, recursive: bool = False
) -> util.FilePathStr:
return self._instance.download(root, recursive) | python | wandb/sdk/wandb_run.py | 3,854 | 3,857 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,913 | checkout | def checkout(self, root: Optional[str] = None) -> str:
return self._instance.checkout(root) | python | wandb/sdk/wandb_run.py | 3,859 | 3,860 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,914 | verify | def verify(self, root: Optional[str] = None) -> Any:
return self._instance.verify(root) | python | wandb/sdk/wandb_run.py | 3,862 | 3,863 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,915 | save | def save(self) -> None:
self._instance.save() | python | wandb/sdk/wandb_run.py | 3,865 | 3,866 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,916 | delete | def delete(self) -> None:
self._instance.delete() | python | wandb/sdk/wandb_run.py | 3,868 | 3,869 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,917 | save | def save(path, overwrite=None):
logger.info("Saving file: %s", path)
wandb.run.save(path) | python | wandb/sdk/wandb_save.py | 11 | 13 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,918 | __init__ | def __init__(self, entry: ArtifactManifestEntry, obj: data_types.WBValue):
self.entry = entry
self.obj = obj | python | wandb/sdk/wandb_artifacts.py | 95 | 97 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,919 | _normalize_metadata | def _normalize_metadata(metadata: Optional[Dict[str, Any]]) -> Dict[str, Any]:
if metadata is None:
return {}
if not isinstance(metadata, dict):
raise TypeError(f"metadata must be dict, not {type(metadata)}")
return cast(
Dict[str, Any], json.loads(json.dumps(util.json_friendly_val(m... | python | wandb/sdk/wandb_artifacts.py | 100 | 107 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,920 | __init__ | def __init__(
self,
name: str,
type: str,
description: Optional[str] = None,
metadata: Optional[dict] = None,
incremental: Optional[bool] = None,
use_as: Optional[str] = None,
) -> None:
if not re.match(r"^[a-zA-Z0-9_\-.]+$", name):
raise V... | python | wandb/sdk/wandb_artifacts.py | 154 | 205 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,921 | id | def id(self) -> Optional[str]:
if self._logged_artifact:
return self._logged_artifact.id
# The artifact hasn't been saved so an ID doesn't exist yet.
return None | python | wandb/sdk/wandb_artifacts.py | 208 | 213 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,922 | source_version | def source_version(self) -> Optional[str]:
if self._logged_artifact:
return self._logged_artifact.source_version
return None | python | wandb/sdk/wandb_artifacts.py | 216 | 220 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,923 | version | def version(self) -> str:
if self._logged_artifact:
return self._logged_artifact.version
raise ArtifactNotLoggedError(self, "version") | python | wandb/sdk/wandb_artifacts.py | 223 | 227 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,924 | entity | def entity(self) -> str:
if self._logged_artifact:
return self._logged_artifact.entity
return self._api.settings("entity") or self._api.viewer().get("entity") # type: ignore | python | wandb/sdk/wandb_artifacts.py | 230 | 233 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,925 | project | def project(self) -> str:
if self._logged_artifact:
return self._logged_artifact.project
return self._api.settings("project") # type: ignore | python | wandb/sdk/wandb_artifacts.py | 236 | 240 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,926 | manifest | def manifest(self) -> ArtifactManifest:
if self._logged_artifact:
return self._logged_artifact.manifest
self.finalize()
return self._manifest | python | wandb/sdk/wandb_artifacts.py | 243 | 248 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,927 | digest | def digest(self) -> str:
if self._logged_artifact:
return self._logged_artifact.digest
self.finalize()
# Digest will be none if the artifact hasn't been saved yet.
return self._digest | python | wandb/sdk/wandb_artifacts.py | 251 | 257 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,928 | type | def type(self) -> str:
if self._logged_artifact:
return self._logged_artifact.type
return self._type | python | wandb/sdk/wandb_artifacts.py | 260 | 264 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,929 | name | def name(self) -> str:
if self._logged_artifact:
return self._logged_artifact.name
return self._name | python | wandb/sdk/wandb_artifacts.py | 267 | 271 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,930 | state | def state(self) -> str:
if self._logged_artifact:
return self._logged_artifact.state
return "PENDING" | python | wandb/sdk/wandb_artifacts.py | 274 | 278 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,931 | size | def size(self) -> int:
if self._logged_artifact:
return self._logged_artifact.size
sizes: List[int]
sizes = []
for entry in self._manifest.entries:
e_size = self._manifest.entries[entry].size
if e_size is not None:
sizes.append(e_size)
... | python | wandb/sdk/wandb_artifacts.py | 281 | 290 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,932 | commit_hash | def commit_hash(self) -> str:
if self._logged_artifact:
return self._logged_artifact.commit_hash
raise ArtifactNotLoggedError(self, "commit_hash") | python | wandb/sdk/wandb_artifacts.py | 293 | 297 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,933 | description | def description(self) -> Optional[str]:
if self._logged_artifact:
return self._logged_artifact.description
return self._description | python | wandb/sdk/wandb_artifacts.py | 300 | 304 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,934 | description | def description(self, desc: Optional[str]) -> None:
if self._logged_artifact:
self._logged_artifact.description = desc
return
self._description = desc | python | wandb/sdk/wandb_artifacts.py | 307 | 312 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,935 | metadata | def metadata(self) -> dict:
if self._logged_artifact:
return self._logged_artifact.metadata
return self._metadata | python | wandb/sdk/wandb_artifacts.py | 315 | 319 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,936 | metadata | def metadata(self, metadata: dict) -> None:
metadata = _normalize_metadata(metadata)
if self._logged_artifact:
self._logged_artifact.metadata = metadata
return
self._metadata = metadata | python | wandb/sdk/wandb_artifacts.py | 322 | 328 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,937 | aliases | def aliases(self) -> List[str]:
if self._logged_artifact:
return self._logged_artifact.aliases
raise ArtifactNotLoggedError(self, "aliases") | python | wandb/sdk/wandb_artifacts.py | 331 | 335 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,938 | aliases | def aliases(self, aliases: List[str]) -> None:
"""Set artifact aliases.
Arguments:
aliases: (list) The list of aliases associated with this artifact.
"""
if self._logged_artifact:
self._logged_artifact.aliases = aliases
return
raise ArtifactN... | python | wandb/sdk/wandb_artifacts.py | 338 | 348 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,939 | use_as | def use_as(self) -> Optional[str]:
return self._use_as | python | wandb/sdk/wandb_artifacts.py | 351 | 352 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,940 | distributed_id | def distributed_id(self) -> Optional[str]:
return self._distributed_id | python | wandb/sdk/wandb_artifacts.py | 355 | 356 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,941 | distributed_id | def distributed_id(self, distributed_id: Optional[str]) -> None:
self._distributed_id = distributed_id | python | wandb/sdk/wandb_artifacts.py | 359 | 360 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,942 | incremental | def incremental(self) -> bool:
return self._incremental | python | wandb/sdk/wandb_artifacts.py | 363 | 364 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,943 | used_by | def used_by(self) -> List["wandb.apis.public.Run"]:
if self._logged_artifact:
return self._logged_artifact.used_by()
raise ArtifactNotLoggedError(self, "used_by") | python | wandb/sdk/wandb_artifacts.py | 366 | 370 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,944 | logged_by | def logged_by(self) -> "wandb.apis.public.Run":
if self._logged_artifact:
return self._logged_artifact.logged_by()
raise ArtifactNotLoggedError(self, "logged_by") | python | wandb/sdk/wandb_artifacts.py | 372 | 376 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,945 | new_file | def new_file(
self, name: str, mode: str = "w", encoding: Optional[str] = None
) -> Generator[IO, None, None]:
self._ensure_can_add()
path = os.path.join(self._artifact_dir.name, name.lstrip("/"))
if os.path.exists(path):
raise ValueError(f"File with name {name!r} already... | python | wandb/sdk/wandb_artifacts.py | 379 | 396 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,946 | add_file | def add_file(
self,
local_path: str,
name: Optional[str] = None,
is_tmp: Optional[bool] = False,
) -> ArtifactManifestEntry:
self._ensure_can_add()
if not os.path.isfile(local_path):
raise ValueError("Path is not a file: %s" % local_path)
name = u... | python | wandb/sdk/wandb_artifacts.py | 398 | 417 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,947 | add_dir | def add_dir(self, local_path: str, name: Optional[str] = None) -> None:
self._ensure_can_add()
if not os.path.isdir(local_path):
raise ValueError("Path is not a directory: %s" % local_path)
termlog(
"Adding directory to artifact (%s)... "
% os.path.join(".", ... | python | wandb/sdk/wandb_artifacts.py | 419 | 452 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,948 | add_manifest_file | def add_manifest_file(log_phy_path: Tuple[str, str]) -> None:
logical_path, physical_path = log_phy_path
self._add_local_file(logical_path, physical_path) | python | wandb/sdk/wandb_artifacts.py | 440 | 442 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,949 | add_reference | def add_reference(
self,
uri: Union[ArtifactManifestEntry, str],
name: Optional[str] = None,
checksum: bool = True,
max_objects: Optional[int] = None,
) -> Sequence[ArtifactManifestEntry]:
self._ensure_can_add()
if name is not None:
name = util.to_... | python | wandb/sdk/wandb_artifacts.py | 454 | 489 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,950 | add | def add(self, obj: data_types.WBValue, name: str) -> ArtifactManifestEntry:
self._ensure_can_add()
name = util.to_forward_slash_path(name)
# This is a "hack" to automatically rename tables added to
# the wandb /media/tables directory to their sha-based name.
# TODO: figure out a... | python | wandb/sdk/wandb_artifacts.py | 491 | 572 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,951 | do_write | def do_write(f: IO) -> None:
import json
# TODO: Do we need to open with utf-8 codec?
f.write(json.dumps(val, sort_keys=True)) | python | wandb/sdk/wandb_artifacts.py | 542 | 546 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,952 | get_path | def get_path(self, name: str) -> ArtifactManifestEntry:
if self._logged_artifact:
return self._logged_artifact.get_path(name)
raise ArtifactNotLoggedError(self, "get_path") | python | wandb/sdk/wandb_artifacts.py | 574 | 578 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,953 | get | def get(self, name: str) -> data_types.WBValue:
if self._logged_artifact:
return self._logged_artifact.get(name)
raise ArtifactNotLoggedError(self, "get") | python | wandb/sdk/wandb_artifacts.py | 580 | 584 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,954 | download | def download(
self, root: Optional[str] = None, recursive: bool = False
) -> FilePathStr:
if self._logged_artifact:
return self._logged_artifact.download(root=root, recursive=recursive)
raise ArtifactNotLoggedError(self, "download") | python | wandb/sdk/wandb_artifacts.py | 586 | 592 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,955 | checkout | def checkout(self, root: Optional[str] = None) -> str:
if self._logged_artifact:
return self._logged_artifact.checkout(root=root)
raise ArtifactNotLoggedError(self, "checkout") | python | wandb/sdk/wandb_artifacts.py | 594 | 598 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,956 | verify | def verify(self, root: Optional[str] = None) -> bool:
if self._logged_artifact:
return self._logged_artifact.verify(root=root)
raise ArtifactNotLoggedError(self, "verify") | python | wandb/sdk/wandb_artifacts.py | 600 | 604 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,957 | save | def save(
self,
project: Optional[str] = None,
settings: Optional["wandb.wandb_sdk.wandb_settings.Settings"] = None,
) -> None:
"""Persist any changes made to the artifact.
If currently in a run, that run will log this artifact. If not currently in a
run, a run of ty... | python | wandb/sdk/wandb_artifacts.py | 606 | 645 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,958 | delete | def delete(self) -> None:
if self._logged_artifact:
return self._logged_artifact.delete()
raise ArtifactNotLoggedError(self, "delete") | python | wandb/sdk/wandb_artifacts.py | 647 | 651 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,959 | wait | def wait(self, timeout: Optional[int] = None) -> ArtifactInterface:
"""Wait for an artifact to finish logging.
Arguments:
timeout: (int, optional) Wait up to this long.
"""
if self._logged_artifact:
return self._logged_artifact.wait(timeout) # type: ignore [call... | python | wandb/sdk/wandb_artifacts.py | 653 | 662 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,960 | get_added_local_path_name | def get_added_local_path_name(self, local_path: str) -> Optional[str]:
"""Get the artifact relative name of a file added by a local filesystem path.
Arguments:
local_path: (str) The local path to resolve into an artifact relative name.
Returns:
str: The artifact relativ... | python | wandb/sdk/wandb_artifacts.py | 664 | 686 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,961 | finalize | def finalize(self) -> None:
"""Mark this artifact as final, disallowing further modifications.
This happens automatically when calling `log_artifact`.
Returns:
None
"""
if self._final:
return self._file_entries
# mark final after all files are a... | python | wandb/sdk/wandb_artifacts.py | 688 | 701 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,962 | json_encode | def json_encode(self) -> Dict[str, Any]:
if not self._logged_artifact:
raise ArtifactNotLoggedError(self, "json_encode")
return util.artifact_to_json(self) | python | wandb/sdk/wandb_artifacts.py | 703 | 706 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,963 | _ensure_can_add | def _ensure_can_add(self) -> None:
if self._final:
raise ArtifactFinalizedError(artifact=self) | python | wandb/sdk/wandb_artifacts.py | 708 | 710 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,964 | _add_local_file | def _add_local_file(
self, name: str, path: str, digest: Optional[B64MD5] = None
) -> ArtifactManifestEntry:
digest = digest or md5_file_b64(path)
size = os.path.getsize(path)
name = util.to_forward_slash_path(name)
with tempfile.NamedTemporaryFile(dir=get_staging_dir(), del... | python | wandb/sdk/wandb_artifacts.py | 712 | 732 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,965 | version | def version(cls) -> int:
return 1 | python | wandb/sdk/wandb_artifacts.py | 737 | 738 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,966 | from_manifest_json | def from_manifest_json(cls, manifest_json: Dict) -> "ArtifactManifestV1":
if manifest_json["version"] != cls.version():
raise ValueError(
"Expected manifest version 1, got %s" % manifest_json["version"]
)
storage_policy_name = manifest_json["storagePolicy"]
... | python | wandb/sdk/wandb_artifacts.py | 741 | 772 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,967 | __init__ | def __init__(
self,
storage_policy: "WandbStoragePolicy",
entries: Optional[Mapping[str, ArtifactManifestEntry]] = None,
) -> None:
super().__init__(storage_policy, entries=entries) | python | wandb/sdk/wandb_artifacts.py | 774 | 779 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,968 | to_manifest_json | def to_manifest_json(self) -> Dict:
"""This is the JSON that's stored in wandb_manifest.json.
If include_local is True we also include the local paths to files. This is
used to represent an artifact that's waiting to be saved on the current
system. We don't need to include the local pat... | python | wandb/sdk/wandb_artifacts.py | 781 | 808 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,969 | digest | def digest(self) -> HexMD5:
hasher = hashlib.md5()
hasher.update(b"wandb-artifact-manifest-v1\n")
for name, entry in sorted(self.entries.items(), key=lambda kv: kv[0]):
hasher.update(f"{name}:{entry.digest}\n".encode())
return HexMD5(hasher.hexdigest()) | python | wandb/sdk/wandb_artifacts.py | 810 | 815 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,970 | name | def name(cls) -> str:
return "wandb-storage-policy-v1" | python | wandb/sdk/wandb_artifacts.py | 820 | 821 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,971 | from_config | def from_config(cls, config: Dict) -> "WandbStoragePolicy":
return cls(config=config) | python | wandb/sdk/wandb_artifacts.py | 824 | 825 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,972 | __init__ | def __init__(
self,
config: Optional[Dict] = None,
cache: Optional[ArtifactsCache] = None,
api: Optional[InternalApi] = None,
) -> None:
self._cache = cache or get_artifacts_cache()
self._config = config or {}
self._session = requests.Session()
adapter... | python | wandb/sdk/wandb_artifacts.py | 827 | 864 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,973 | config | def config(self) -> Dict:
return self._config | python | wandb/sdk/wandb_artifacts.py | 866 | 867 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,974 | load_file | def load_file(
self,
artifact: ArtifactInterface,
manifest_entry: ArtifactManifestEntry,
) -> str:
path, hit, cache_open = self._cache.check_md5_obj_path(
B64MD5(manifest_entry.digest), # TODO(spencerpearson): unsafe cast
manifest_entry.size if manifest_entry... | python | wandb/sdk/wandb_artifacts.py | 869 | 891 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,975 | store_reference | def store_reference(
self,
artifact: ArtifactInterface,
path: Union[URIStr, FilePathStr],
name: Optional[str] = None,
checksum: bool = True,
max_objects: Optional[int] = None,
) -> Sequence[ArtifactManifestEntry]:
return self._handler.store_path(
a... | python | wandb/sdk/wandb_artifacts.py | 893 | 903 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,976 | load_reference | def load_reference(
self,
manifest_entry: ArtifactManifestEntry,
local: bool = False,
) -> str:
return self._handler.load_path(manifest_entry, local) | python | wandb/sdk/wandb_artifacts.py | 905 | 910 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,977 | _file_url | def _file_url(
self, api: InternalApi, entity_name: str, manifest_entry: ArtifactManifestEntry
) -> str:
storage_layout = self._config.get("storageLayout", StorageLayout.V1)
storage_region = self._config.get("storageRegion", "default")
md5_hex = b64_to_hex_id(B64MD5(manifest_entry.di... | python | wandb/sdk/wandb_artifacts.py | 912 | 936 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,978 | store_file_sync | def store_file_sync(
self,
artifact_id: str,
artifact_manifest_id: str,
entry: ArtifactManifestEntry,
preparer: "StepPrepare",
progress_callback: Optional["progress.ProgressFn"] = None,
) -> bool:
"""Upload a file to the artifact store.
Returns:
... | python | wandb/sdk/wandb_artifacts.py | 938 | 980 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,979 | store_file_async | async def store_file_async(
self,
artifact_id: str,
artifact_manifest_id: str,
entry: ArtifactManifestEntry,
preparer: "StepPrepare",
progress_callback: Optional["progress.ProgressFn"] = None,
) -> bool:
"""Async equivalent to `store_file_sync`."""
res... | python | wandb/sdk/wandb_artifacts.py | 982 | 1,020 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,980 | _write_cache | def _write_cache(self, entry: ArtifactManifestEntry) -> None:
if entry.local_path is None:
return
# Cache upon successful upload.
_, hit, cache_open = self._cache.check_md5_obj_path(
B64MD5(entry.digest),
entry.size if entry.size is not None else 0,
)... | python | wandb/sdk/wandb_artifacts.py | 1,022 | 1,033 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,981 | name | def name(cls) -> str:
return "wandb-s3-bucket-policy-v1" | python | wandb/sdk/wandb_artifacts.py | 1,039 | 1,040 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,982 | from_config | def from_config(cls, config: Dict[str, str]) -> "__S3BucketPolicy":
if "bucket" not in config:
raise ValueError("Bucket name not found in config")
return cls(config["bucket"]) | python | wandb/sdk/wandb_artifacts.py | 1,043 | 1,046 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,983 | __init__ | def __init__(self, bucket: str) -> None:
self._bucket = bucket
s3 = S3Handler(bucket)
local = LocalFileHandler()
self._handler = MultiHandler(
handlers=[
s3,
local,
],
default_handler=TrackingHandler(),
) | python | wandb/sdk/wandb_artifacts.py | 1,048 | 1,059 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,984 | config | def config(self) -> Dict[str, str]:
return {"bucket": self._bucket} | python | wandb/sdk/wandb_artifacts.py | 1,061 | 1,062 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,985 | load_path | def load_path(
self,
manifest_entry: ArtifactManifestEntry,
local: bool = False,
) -> Union[URIStr, FilePathStr]:
return self._handler.load_path(manifest_entry, local=local) | python | wandb/sdk/wandb_artifacts.py | 1,064 | 1,069 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,986 | store_path | def store_path(
self,
artifact: ArtifactInterface,
path: Union[URIStr, FilePathStr],
name: Optional[str] = None,
checksum: bool = True,
max_objects: Optional[int] = None,
) -> Sequence[ArtifactManifestEntry]:
return self._handler.store_path(
artifa... | python | wandb/sdk/wandb_artifacts.py | 1,071 | 1,081 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,987 | __init__ | def __init__(
self,
handlers: Optional[List[StorageHandler]] = None,
default_handler: Optional[StorageHandler] = None,
) -> None:
self._handlers = {}
self._default_handler = default_handler
handlers = handlers or []
for handler in handlers:
self._... | python | wandb/sdk/wandb_artifacts.py | 1,087 | 1,097 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,988 | scheme | def scheme(self) -> str:
raise NotImplementedError | python | wandb/sdk/wandb_artifacts.py | 1,100 | 1,101 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,989 | load_path | def load_path(
self,
manifest_entry: ArtifactManifestEntry,
local: bool = False,
) -> Union[URIStr, FilePathStr]:
url = urlparse(manifest_entry.ref)
if url.scheme not in self._handlers:
if self._default_handler is not None:
return self._default_han... | python | wandb/sdk/wandb_artifacts.py | 1,103 | 1,115 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,990 | store_path | def store_path(
self,
artifact: ArtifactInterface,
path: Union[URIStr, FilePathStr],
name: Optional[str] = None,
checksum: bool = True,
max_objects: Optional[int] = None,
) -> Sequence[ArtifactManifestEntry]:
url = urlparse(path)
if url.scheme not in s... | python | wandb/sdk/wandb_artifacts.py | 1,117 | 1,142 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,991 | __init__ | def __init__(self, scheme: Optional[str] = None) -> None:
"""Track paths with no modification or special processing.
Useful when paths being tracked are on file systems mounted at a standardized
location.
For example, if the data to track is located on an NFS share mounted on
`... | python | wandb/sdk/wandb_artifacts.py | 1,146 | 1,155 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,992 | scheme | def scheme(self) -> str:
return self._scheme | python | wandb/sdk/wandb_artifacts.py | 1,158 | 1,159 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,993 | load_path | def load_path(
self,
manifest_entry: ArtifactManifestEntry,
local: bool = False,
) -> Union[URIStr, FilePathStr]:
if local:
# Likely a user error. The tracking handler is
# oblivious to the underlying paths, so it has
# no way of actually loading i... | python | wandb/sdk/wandb_artifacts.py | 1,161 | 1,177 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,994 | store_path | def store_path(
self,
artifact: ArtifactInterface,
path: Union[URIStr, FilePathStr],
name: Optional[str] = None,
checksum: bool = True,
max_objects: Optional[int] = None,
) -> Sequence[ArtifactManifestEntry]:
url = urlparse(path)
if name is None:
... | python | wandb/sdk/wandb_artifacts.py | 1,179 | 1,198 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,995 | __init__ | def __init__(self, scheme: Optional[str] = None) -> None:
"""Track files or directories on a local filesystem.
Expand directories to create an entry for each file contained.
"""
self._scheme = scheme or "file"
self._cache = get_artifacts_cache() | python | wandb/sdk/wandb_artifacts.py | 1,207 | 1,213 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,996 | scheme | def scheme(self) -> str:
return self._scheme | python | wandb/sdk/wandb_artifacts.py | 1,216 | 1,217 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,997 | load_path | def load_path(
self,
manifest_entry: ArtifactManifestEntry,
local: bool = False,
) -> Union[URIStr, FilePathStr]:
if manifest_entry.ref is None:
raise ValueError(f"Cannot add path with no ref: {manifest_entry.path}")
local_path = util.local_file_uri_to_path(str(ma... | python | wandb/sdk/wandb_artifacts.py | 1,219 | 1,250 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,998 | store_path | def store_path(
self,
artifact: ArtifactInterface,
path: Union[URIStr, FilePathStr],
name: Optional[str] = None,
checksum: bool = True,
max_objects: Optional[int] = None,
) -> Sequence[ArtifactManifestEntry]:
local_path = util.local_file_uri_to_path(path)
... | python | wandb/sdk/wandb_artifacts.py | 1,252 | 1,319 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,999 | md5 | def md5(path: str) -> B64MD5:
return (
md5_file_b64(path)
if checksum
else md5_string(str(os.stat(path).st_size))
) | python | wandb/sdk/wandb_artifacts.py | 1,266 | 1,271 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
3,000 | __init__ | def __init__(self, scheme: Optional[str] = None) -> None:
self._scheme = scheme or "s3"
self._s3 = None
self._versioning_enabled = None
self._cache = get_artifacts_cache() | python | wandb/sdk/wandb_artifacts.py | 1,327 | 1,331 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.