repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
wandb | wandb/sdk/artifacts/_models/registry.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING, Any
from pydantic import Field, field_validator
from typing_extensions import Self
from wandb._pydantic import GQLId
from wandb._strutils import nameof
from wandb.apis.public.registries._freezable_list import AddOnlyArtifactTypesList
from wandb.api... | 122 | 4,294 |
wandb | wandb/sdk/artifacts/_models/base_model.py | .py | from __future__ import annotations
from abc import ABC
from pydantic import ConfigDict
from wandb._pydantic import JsonableModel
# Abstract base class with a common default configuration that's shared by all
# pydantic classes in artifacts code (excluding GraphQL-generated types).
class ArtifactsBase(JsonableModel... | 21 | 761 |
wandb | wandb/sdk/artifacts/_models/pagination.py | .py | """Artifacts-specific data models for handling paginated results from GraphQL queries."""
from wandb._pydantic import Connection, ConnectionWithTotal
from .._generated.fragments import (
ArtifactCollectionFragment,
ArtifactFragment,
ArtifactMembershipFragment,
ArtifactTypeFragment,
FileFragment,
... | 28 | 985 |
wandb | wandb/sdk/artifacts/_generated/artifact_membership_files.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from typing import Literal
from pydantic import Field
from wandb._pydantic import GQLResult, Typename
from .fragments import FileFragment, PageInfoFragment
class ArtifactMembershipFiles(GQLResult):
pr... | 62 | 1,958 |
wandb | wandb/sdk/artifacts/_generated/artifact_by_id.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import ArtifactFragment
class ArtifactByID(GQLResult):
artifact: ArtifactFragment | None
ArtifactByID.model_rebuild()
| 16 | 292 |
wandb | wandb/sdk/artifacts/_generated/run_output_artifacts.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactFragment, PageInfoFragment
class RunOutputArtifacts(GQLResult):
project: RunOutputArtifactsProject | None... | 40 | 1,080 |
wandb | wandb/sdk/artifacts/_generated/fetch_registry.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import RegistryFragment
class FetchRegistry(GQLResult):
entity: FetchRegistryEntity | None
class FetchRegistryEntity(GQLResult):
project: Regi... | 21 | 408 |
wandb | wandb/sdk/artifacts/_generated/operations.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
__all__ = [
"ADD_ALIASES_GQL",
"ADD_ARTIFACT_COLLECTION_TAGS_GQL",
"ARTIFACT_BY_ID_GQL",
"ARTIFACT_COLLECTION_ALIASES_GQL",
"ARTIFACT_CREATED_BY_GQL",
"ARTIFACT_MEMBERSHIP_BY_NAME_GQL",
"ARTIFACT_MEMBERSHIP_FILES_GQL"... | 1,909 | 31,990 |
wandb | wandb/sdk/artifacts/_generated/input_types.py | .py | # Generated by ariadne-codegen
# Source: core/api/graphql/schemas/schema-latest.graphql
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLId, GQLInput
class AddAliasesInput(GQLInput):
aliases: list[ArtifactCollectionAliasInput]
artifact_id: GQLId = Field(alias="ar... | 218 | 8,557 |
wandb | wandb/sdk/artifacts/_generated/delete_artifact.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLId, GQLResult
class DeleteArtifact(GQLResult):
result: DeleteArtifactResult | None
class DeleteArtifactResult(GQLResult):
artifact: DeleteArtifactResultArtifact
cla... | 23 | 448 |
wandb | wandb/sdk/artifacts/_generated/delete_artifact_sequence.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from typing import Literal
from pydantic import Field
from wandb._pydantic import GQLResult, Typename
from .enums import ArtifactCollectionState
class DeleteArtifactSequence(GQLResult):
result: Delete... | 34 | 820 |
wandb | wandb/sdk/artifacts/_generated/unlink_artifact.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
class UnlinkArtifact(GQLResult):
result: UnlinkArtifactResult | None
class UnlinkArtifactResult(GQLResult):
success: bool
UnlinkArtifact.model_rebuild()
| 18 | 316 |
wandb | wandb/sdk/artifacts/_generated/fetch_linked_artifacts.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactAliasFragment, CollectionInfoFragment
class FetchLinkedArtifacts(GQLResult):
artifact: FetchLinkedArtifac... | 44 | 1,370 |
wandb | wandb/sdk/artifacts/_generated/project_artifact_types.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactTypeFragment, PageInfoFragment
class ProjectArtifactTypes(GQLResult):
project: ProjectArtifactTypesProjec... | 36 | 971 |
wandb | wandb/sdk/artifacts/_generated/delete_registry.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
class DeleteRegistry(GQLResult):
delete_model: DeleteRegistryDeleteModel | None = Field(alias="deleteModel")
class DeleteRegistryDelete... | 20 | 396 |
wandb | wandb/sdk/artifacts/_generated/artifact_membership_by_name.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactMembershipFragment
class ArtifactMembershipByName(GQLResult):
project: ArtifactMembershipByNameProject | ... | 25 | 598 |
wandb | wandb/sdk/artifacts/_generated/fetch_registries.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import PageInfoFragment, RegistryFragment
class FetchRegistries(GQLResult):
organization: FetchRegistriesOrganization | ... | 39 | 1,135 |
wandb | wandb/sdk/artifacts/_generated/fetch_advanced_registry_features.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
class FetchAdvancedRegistryFeatures(GQLResult):
organization: FetchAdvancedRegistryFeaturesOrganization | None
class FetchAdvancedRegis... | 27 | 769 |
wandb | wandb/sdk/artifacts/_generated/get_artifact_membership_file_urls.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from typing import Literal
from pydantic import Field
from wandb._pydantic import GQLResult, Typename
from .fragments import FileWithUrlFragment, PageInfoFragment
class GetArtifactMembershipFileUrls(GQLRe... | 64 | 2,018 |
wandb | wandb/sdk/artifacts/_generated/registry_versions.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactMembershipFragment, PageInfoFragment
class RegistryVersions(GQLResult):
organization: RegistryVersionsOrg... | 42 | 1,314 |
wandb | wandb/sdk/artifacts/_generated/run_input_artifacts.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactFragment, PageInfoFragment
class RunInputArtifacts(GQLResult):
project: RunInputArtifactsProject | None
... | 40 | 1,066 |
wandb | wandb/sdk/artifacts/_generated/delete_artifact_portfolio.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from typing import Literal
from pydantic import Field
from wandb._pydantic import GQLResult, Typename
from .enums import ArtifactCollectionState
class DeleteArtifactPortfolio(GQLResult):
result: Delet... | 34 | 827 |
wandb | wandb/sdk/artifacts/_generated/fragments.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from typing import Literal
from pydantic import Field
from wandb._pydantic import GQLId, GQLResult, Typename
from .enums import ArtifactState
class ArtifactAliasFragment(GQLResult):
typename__: Typena... | 320 | 9,033 |
wandb | wandb/sdk/artifacts/_generated/registry_team_members.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import TeamRegistryMemberFragment
class RegistryTeamMembers(GQLResult):
project: RegistryTeamMembersProject | None
cla... | 23 | 523 |
wandb | wandb/sdk/artifacts/_generated/artifact_used_by.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import RunInfoFragment
class ArtifactUsedBy(GQLResult):
artifact: ArtifactUsedByArtifact | None
class ArtifactUsedByAr... | 33 | 752 |
wandb | wandb/sdk/artifacts/_generated/__init__.py | .py | # Generated by ariadne-codegen
__all__ = [
"ADD_ALIASES_GQL",
"ADD_ARTIFACT_COLLECTION_TAGS_GQL",
"ARTIFACT_BY_ID_GQL",
"ARTIFACT_COLLECTION_ALIASES_GQL",
"ARTIFACT_CREATED_BY_GQL",
"ARTIFACT_MEMBERSHIP_BY_NAME_GQL",
"ARTIFACT_MEMBERSHIP_FILES_GQL",
"ARTIFACT_TYPE_ARTIFACT_COLLECTIONS_G... | 297 | 9,893 |
wandb | wandb/sdk/artifacts/_generated/project_artifact_collections.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactCollectionFragment, PageInfoFragment
class ProjectArtifactCollections(GQLResult):
project: ProjectArtifac... | 37 | 1,176 |
wandb | wandb/sdk/artifacts/_generated/project_artifact_type.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactTypeFragment
class ProjectArtifactType(GQLResult):
project: ProjectArtifactTypeProject | None
class Pro... | 23 | 514 |
wandb | wandb/sdk/artifacts/_generated/update_artifact.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import ArtifactFragment
class UpdateArtifact(GQLResult):
result: UpdateArtifactResult | None
class UpdateArtifactResult(GQLResult):
artifact: ... | 21 | 407 |
wandb | wandb/sdk/artifacts/_generated/fetch_org_info_from_entity.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import OrgInfoFragment
class FetchOrgInfoFromEntity(GQLResult):
entity: FetchOrgInfoFromEntityEntity | None
class FetchOrgInfoFromEntityEntity(GQL... | 27 | 649 |
wandb | wandb/sdk/artifacts/_generated/artifact_type_artifact_collections.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactCollectionFragment, PageInfoFragment
class ArtifactTypeArtifactCollections(GQLResult):
project: ArtifactT... | 48 | 1,561 |
wandb | wandb/sdk/artifacts/_generated/update_team_registry_role.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
class UpdateTeamRegistryRole(GQLResult):
result: UpdateTeamRegistryRoleResult | None
class UpdateTeamRegistryRoleResult(GQLResult):
success: bool
UpdateTeamR... | 18 | 348 |
wandb | wandb/sdk/artifacts/_generated/upsert_registry.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import RegistryFragment
class UpsertRegistry(GQLResult):
upsert_model: UpsertRegistryUpsertModel | None = Field(alias="u... | 24 | 517 |
wandb | wandb/sdk/artifacts/_generated/enums.py | .py | # Generated by ariadne-codegen
# Source: core/api/graphql/schemas/schema-latest.graphql
from __future__ import annotations
from enum import Enum
class ArtifactCollectionState(str, Enum):
DELETED = "DELETED"
READY = "READY"
class ArtifactCollectionType(str, Enum):
PORTFOLIO = "PORTFOLIO"
SEQUENCE =... | 23 | 442 |
wandb | wandb/sdk/artifacts/_generated/rename_registry.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import RegistryFragment
class RenameRegistry(GQLResult):
rename_project: RenameRegistryRenameProject | None = Field(alia... | 24 | 527 |
wandb | wandb/sdk/artifacts/_generated/delete_aliases.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
class DeleteAliases(GQLResult):
result: DeleteAliasesResult | None
class DeleteAliasesResult(GQLResult):
success: bool
DeleteAliases.model_rebuild()
| 18 | 312 |
wandb | wandb/sdk/artifacts/_generated/project_artifact_collection.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactCollectionFragment
class ProjectArtifactCollection(GQLResult):
project: ProjectArtifactCollectionProject ... | 32 | 823 |
wandb | wandb/sdk/artifacts/_generated/artifact_created_by.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from typing import Annotated, Literal
from pydantic import Field
from wandb._pydantic import GQLResult, Typename
from .fragments import RunInfoFragment
class ArtifactCreatedBy(GQLResult):
artifact: Ar... | 35 | 788 |
wandb | wandb/sdk/artifacts/_generated/artifact_type.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
class ArtifactType(GQLResult):
project: ArtifactTypeProject | None
class ArtifactTypeProject(GQLResult):
artifact: ArtifactTypeProj... | 30 | 661 |
wandb | wandb/sdk/artifacts/_generated/update_user_registry_role.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
class UpdateUserRegistryRole(GQLResult):
result: UpdateUserRegistryRoleResult | None
class UpdateUserRegistryRoleResult(GQLResult):
success: bool
UpdateUserR... | 18 | 348 |
wandb | wandb/sdk/artifacts/_generated/artifact_collection_aliases.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from typing import Literal
from pydantic import Field
from wandb._pydantic import GQLResult, Typename
from .fragments import ArtifactAliasFragment, PageInfoFragment
class ArtifactCollectionAliases(GQLResu... | 41 | 1,250 |
wandb | wandb/sdk/artifacts/_generated/delete_artifact_collection_tags.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
class DeleteArtifactCollectionTags(GQLResult):
result: DeleteArtifactCollectionTagsResult | None
class DeleteArtifactCollectionTagsResult(GQLResult):
success: ... | 18 | 372 |
wandb | wandb/sdk/artifacts/_generated/project_artifacts.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from typing import Literal
from pydantic import Field
from wandb._pydantic import GQLResult, Typename
from .fragments import ArtifactFragment, PageInfoFragment
class ProjectArtifacts(GQLResult):
proje... | 55 | 1,736 |
wandb | wandb/sdk/artifacts/_generated/add_artifact_collection_tags.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import TagFragment
class AddArtifactCollectionTags(GQLResult):
result: AddArtifactCollectionTagsResult | None
class AddArtifactCollectionTagsResul... | 21 | 454 |
wandb | wandb/sdk/artifacts/_generated/delete_registry_members.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
class DeleteRegistryMembers(GQLResult):
result: DeleteRegistryMembersResult | None
class DeleteRegistryMembersResult(GQLResult):
success: bool
DeleteRegistry... | 18 | 344 |
wandb | wandb/sdk/artifacts/_generated/fetch_organization.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from typing import Literal
from pydantic import Field
from wandb._pydantic import GQLId, GQLResult, Typename
class FetchOrganization(GQLResult):
organization: FetchOrganizationOrganization | None
cla... | 32 | 751 |
wandb | wandb/sdk/artifacts/_generated/update_artifact_sequence.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactCollectionFragment
class UpdateArtifactSequence(GQLResult):
result: UpdateArtifactSequenceResult | None
... | 23 | 542 |
wandb | wandb/sdk/artifacts/_generated/update_artifact_sequence_type.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactCollectionFragment
class UpdateArtifactSequenceType(GQLResult):
result: UpdateArtifactSequenceTypeResult ... | 25 | 583 |
wandb | wandb/sdk/artifacts/_generated/link_artifact.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactMembershipFragment
class LinkArtifact(GQLResult):
result: LinkArtifactResult | None
class LinkArtifactR... | 26 | 587 |
wandb | wandb/sdk/artifacts/_generated/update_artifact_portfolio.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ArtifactCollectionFragment
class UpdateArtifactPortfolio(GQLResult):
result: UpdateArtifactPortfolioResult | None... | 23 | 547 |
wandb | wandb/sdk/artifacts/_generated/add_aliases.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
class AddAliases(GQLResult):
result: AddAliasesResult | None
class AddAliasesResult(GQLResult):
success: bool
AddAliases.model_rebuild()
| 18 | 300 |
wandb | wandb/sdk/artifacts/_generated/create_registry_members.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
class CreateRegistryMembers(GQLResult):
result: CreateRegistryMembersResult | None
class CreateRegistryMembersResult(GQLResult):
success: bool
CreateRegistry... | 18 | 344 |
wandb | wandb/sdk/artifacts/_generated/registry_collections.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import PageInfoFragment, RegistryCollectionFragment
class RegistryCollections(GQLResult):
organization: RegistryCollecti... | 45 | 1,419 |
wandb | wandb/sdk/artifacts/_generated/fetch_artifact_manifest.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import DeferredManifestFragment
class FetchArtifactManifest(GQLResult):
artifact: FetchArtifactManifestArtifact | None
... | 23 | 542 |
wandb | wandb/sdk/artifacts/_generated/registry_user_members.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/artifacts/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import UserRegistryMemberFragment
class RegistryUserMembers(GQLResult):
project: RegistryUserMembersProject | None
class RegistryUserMembersProjec... | 21 | 461 |
wandb | wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py | .py | """WB artifact storage handler."""
from __future__ import annotations
import os
from typing import TYPE_CHECKING, Literal
from urllib.parse import urlparse
from wandb.apis import PublicApi
from wandb.sdk.artifacts.artifact_file_cache import get_artifact_file_cache
from wandb.sdk.artifacts.artifact_manifest_entry imp... | 131 | 4,764 |
wandb | wandb/sdk/artifacts/storage_handlers/multi_handler.py | .py | """Multi storage handler."""
from __future__ import annotations
from typing import TYPE_CHECKING
from urllib.parse import urlparse
from wandb.sdk.artifacts.storage_handler import StorageHandler, _BaseStorageHandler
from wandb.sdk.lib.paths import FilePathStr, URIStr
if TYPE_CHECKING:
from wandb.sdk.artifacts.ar... | 58 | 1,898 |
wandb | wandb/sdk/artifacts/storage_handlers/local_file_handler.py | .py | """Local file storage handler."""
from __future__ import annotations
import os
import shutil
from collections import deque
from collections.abc import Callable
from pathlib import Path
from typing import TYPE_CHECKING
from urllib.parse import ParseResult
from wandb.errors.term import termlog
from wandb.sdk.artifacts... | 151 | 5,564 |
wandb | wandb/sdk/artifacts/storage_handlers/s3_handler.py | .py | """S3 storage handler."""
from __future__ import annotations
import os
import re
from pathlib import PurePosixPath
from typing import TYPE_CHECKING
from urllib.parse import parse_qsl, urlparse
from wandb import util
from wandb._strutils import ensureprefix
from wandb.errors import CommError
from wandb.errors.term im... | 343 | 12,853 |
wandb | wandb/sdk/artifacts/storage_handlers/_timing.py | .py | from __future__ import annotations
import time
from contextlib import AbstractContextManager
from typing import TYPE_CHECKING
from wandb.errors.term import termlog
if TYPE_CHECKING:
from types import TracebackType
from typing_extensions import Self
class TimedIf(AbstractContextManager):
"""Context man... | 35 | 938 |
wandb | wandb/sdk/artifacts/storage_handlers/tracking_handler.py | .py | """Tracking storage handler."""
from __future__ import annotations
from typing import TYPE_CHECKING
from urllib.parse import urlparse
from wandb.errors.term import termwarn
from wandb.sdk.artifacts.artifact_manifest_entry import ArtifactManifestEntry
from wandb.sdk.artifacts.storage_handler import StorageHandler
fro... | 71 | 2,476 |
wandb | wandb/sdk/artifacts/storage_handlers/gcs_handler.py | .py | """GCS storage handler."""
from __future__ import annotations
from pathlib import PurePosixPath
from typing import TYPE_CHECKING, Optional
from urllib.parse import ParseResult, urlparse
from pydantic.dataclasses import dataclass as pydantic_dataclass
from typing_extensions import Never, Self
import wandb
from wandb... | 260 | 9,140 |
wandb | wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py | .py | """WB local artifact storage handler."""
from __future__ import annotations
import os
from typing import TYPE_CHECKING, Literal
from urllib.parse import urlparse
import wandb
from wandb.sdk.artifacts.artifact_instance_cache import (
artifact_instance_cache_by_client_id,
)
from wandb.sdk.artifacts.artifact_manife... | 83 | 2,672 |
wandb | wandb/sdk/artifacts/storage_handlers/azure_handler.py | .py | """Azure storage handler."""
from __future__ import annotations
from pathlib import PurePosixPath
from types import ModuleType
from typing import TYPE_CHECKING
from urllib.parse import ParseResult, parse_qsl, urlparse
import wandb
from wandb import util
from wandb.sdk.artifacts.artifact_file_cache import get_artifac... | 220 | 8,472 |
wandb | wandb/sdk/artifacts/storage_handlers/http_handler.py | .py | """HTTP storage handler."""
from __future__ import annotations
import os
from dataclasses import asdict
from typing import TYPE_CHECKING, Any, Dict, Optional, cast # noqa: UP035
from urllib.parse import ParseResult
from pydantic.dataclasses import dataclass as pydantic_dataclass
from typing_extensions import Self
... | 121 | 4,447 |
wandb | wandb/sdk/artifacts/storage_policies/__init__.py | .py | from wandb.sdk.artifacts.storage_policies.register import WANDB_STORAGE_POLICY
from wandb.sdk.artifacts.storage_policies.wandb_storage_policy import WandbStoragePolicy
__all__ = ["WANDB_STORAGE_POLICY", "WandbStoragePolicy"]
| 5 | 226 |
wandb | wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py | .py | """WandB storage policy."""
from __future__ import annotations
import concurrent.futures
import hashlib
import logging
import os
import shutil
from collections import deque
from operator import itemgetter
from typing import TYPE_CHECKING, Any
from urllib.parse import quote
import requests
from typing_extensions impo... | 385 | 14,013 |
wandb | wandb/sdk/artifacts/storage_policies/_factories.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING, Final
from ..storage_handler import StorageHandler
from ..storage_handlers.azure_handler import AzureHandler
from ..storage_handlers.gcs_handler import GCSHandler
from ..storage_handlers.http_handler import HTTPHandler
from ..storage_handlers.local_... | 78 | 2,819 |
wandb | wandb/sdk/artifacts/storage_policies/_multipart.py | .py | """Helpers and constants for multipart upload and download."""
from __future__ import annotations
import logging
import math
import threading
from collections.abc import Callable, Iterator
from concurrent.futures import FIRST_EXCEPTION, Executor, ThreadPoolExecutor, wait
from dataclasses import dataclass, field
from ... | 303 | 11,036 |
wandb | wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py | .py | """Artifact manifest v1."""
# Keep older-style type annotations in this legacy model.
# ruff: noqa: UP006, UP035
from __future__ import annotations
from operator import itemgetter
from typing import Annotated, Any, ClassVar, Dict, Literal, final
from pydantic import Field
from wandb.sdk.lib.hashutil import HexMD5,... | 73 | 2,696 |
wandb | wandb/sdk/integration_utils/auto_logging.py | .py | from __future__ import annotations
import asyncio
import functools
import inspect
import logging
from collections.abc import Sequence
from typing import Any, Protocol, TypeVar
import wandb.sdk
import wandb.util
from wandb.sdk.lib import telemetry as wb_telemetry
from wandb.sdk.lib.timer import Timer
logger = logging... | 234 | 8,163 |
wandb | wandb/sdk/interface/summary_record.py | .py | """Summary Record.
This module implements a summary record as an intermediate format before being converted
to a protocol buffer.
"""
from __future__ import annotations
import typing as t
class SummaryRecord:
"""Encodes a diff -- analogous to the SummaryRecord protobuf message."""
update: list[SummaryItem... | 70 | 1,703 |
wandb | wandb/sdk/interface/interface_sock.py | .py | from __future__ import annotations
import logging
from typing import TYPE_CHECKING
from typing_extensions import override
from wandb.proto import wandb_server_pb2 as spb
from wandb.sdk.lib import asyncio_manager
from .interface_shared import InterfaceShared
if TYPE_CHECKING:
from wandb.proto import wandb_inter... | 60 | 1,779 |
wandb | wandb/sdk/interface/interface_queue.py | .py | from __future__ import annotations
import logging
from multiprocessing.process import BaseProcess
from typing import TYPE_CHECKING
from typing_extensions import override
from .interface_shared import InterfaceShared
if TYPE_CHECKING:
from queue import Queue
from wandb.proto import wandb_internal_pb2 as pb
... | 60 | 1,736 |
wandb | wandb/sdk/interface/interface_shared.py | .py | from __future__ import annotations
import abc
import logging
from typing import Any, cast
from typing_extensions import override
from wandb.proto import wandb_internal_pb2 as pb
from wandb.proto import wandb_telemetry_pb2 as tpb
from wandb.sdk.mailbox import MailboxHandle
from wandb.util import json_dumps_safer, jso... | 499 | 17,895 |
wandb | wandb/sdk/interface/interface.py | .py | from __future__ import annotations
import abc
import gzip
import logging
import time
from collections.abc import Iterable
from pathlib import Path
from secrets import token_hex
from typing import TYPE_CHECKING, Any
from wandb import termwarn
from wandb.proto import wandb_internal_pb2 as pb
from wandb.proto import wan... | 1,071 | 38,543 |
wandb | wandb/sdk/lib/filesystem.py | .py | from __future__ import annotations
import contextlib
import ctypes
import dataclasses
import errno
import logging
import os
import platform
import re
import shutil
import tempfile
import threading
from collections.abc import Generator, Iterable
from pathlib import Path, PurePath
from typing import IO, Any, BinaryIO, L... | 570 | 20,182 |
wandb | wandb/sdk/lib/progress.py | .py | """Defines an object for printing run progress at the end of a script."""
from __future__ import annotations
import asyncio
import contextlib
import time
from collections.abc import Generator
from typing import NoReturn
from wandb.proto import wandb_internal_pb2 as pb
from wandb.sdk.interface import interface
from w... | 360 | 11,159 |
wandb | wandb/sdk/lib/telemetry.py | .py | from __future__ import annotations
import re
import sys
from contextlib import AbstractContextManager
from types import TracebackType
from typing import TYPE_CHECKING
import wandb
from wandb.proto.wandb_telemetry_pb2 import Imports as TelemetryImports
from wandb.proto.wandb_telemetry_pb2 import TelemetryRecord
# avo... | 104 | 2,765 |
wandb | wandb/sdk/lib/interrupt.py | .py | """Utility to send an interrupt (Ctrl+C) signal to the main thread.
This is necessary because Windows and POSIX use different models for Ctrl+C
interrupts.
"""
import platform
import signal
import threading
def interrupt_main():
"""Interrupt the main Python thread with a SIGINT signal.
In POSIX, signal.pth... | 38 | 1,353 |
wandb | wandb/sdk/lib/timed_input.py | .py | """timed_input: add a timeout to standard input.
Approach was inspired by: https://github.com/johejo/inputimeout
"""
import sys
import threading
import wandb
SP = " "
CR = "\r"
LF = "\n"
CRLF = CR + LF
def _echo(prompt: str, *, err: bool) -> None:
stream = sys.stderr if err else sys.stdout
stream.write(pr... | 141 | 3,508 |
wandb | wandb/sdk/lib/import_hooks.py | .py | """Implements a post-import hook mechanism.
Styled as per PEP-369. Note that it doesn't cope with modules being reloaded.
Note: This file is based on
https://github.com/GrahamDumpleton/wrapt/blob/1.12.1/src/wrapt/importer.py
and manual backports of later patches up to 1.15.0 in the wrapt repository
(with slight modif... | 277 | 10,285 |
wandb | wandb/sdk/lib/noop_run.py | .py | """Implementation for WANDB_MODE=disabled."""
import time
from typing import cast
from typing_extensions import Self, override
import wandb
from wandb.sdk import wandb_config, wandb_metric, wandb_run, wandb_settings
from wandb.sdk.artifacts import artifact
from wandb.sdk.lib import module
from wandb.sdk.lib.disabled... | 143 | 3,653 |
wandb | wandb/sdk/lib/file_stream_utils.py | .py | #
from collections.abc import Iterable
from typing import Any
def split_files(
files: dict[str, Any], max_bytes: int = 10 * 1024 * 1024
) -> Iterable[dict[str, dict]]:
"""Split a file's dict (see `files` arg) into smaller dicts.
Each smaller dict will have at most `MAX_BYTES` size.
This method is u... | 121 | 4,040 |
wandb | wandb/sdk/lib/printer.py | .py | """Terminal, Jupyter and file output for W&B."""
from __future__ import annotations
import abc
import contextlib
import itertools
import platform
import sys
from collections.abc import Callable, Generator
import click
from typing_extensions import override
import wandb
import wandb.util
from wandb.errors import ter... | 559 | 15,879 |
wandb | wandb/sdk/lib/wb_logging.py | .py | """Logging configuration for the "wandb" logger.
Most log statements in wandb are made in the context of a run and should be
redirected to that run's log file (usually named 'debug.log'). This module
provides a context manager to temporarily set the current run ID and registers
a global handler for the 'wandb' logger ... | 163 | 4,908 |
wandb | wandb/sdk/lib/disabled.py | .py | from typing import Any
class SummaryDisabled(dict):
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
def __getattr__(self, key):
return self[key]
def __getitem__(self, key):
val = dict.__getitem__(self, key)
if isinstance(val, dict) and not isinstance(val, Summar... | 31 | 963 |
wandb | wandb/sdk/lib/asyncio_manager.py | .py | """Implements an asyncio thread suitable for internal wandb use."""
from __future__ import annotations
import asyncio
import concurrent.futures
import contextlib
import logging
import os
import threading
from collections.abc import Awaitable, Callable
from typing import TypeVar
from . import asyncio_compat
_T = Typ... | 290 | 10,196 |
wandb | wandb/sdk/lib/gitlib.py | .py | from __future__ import annotations
import logging
import os
import re
import shutil
import subprocess
from dataclasses import dataclass
from urllib.parse import urlparse, urlunparse
import wandb
logger = logging.getLogger(__name__)
# The environment variable GitPython used for locating the git executable,
# honored... | 420 | 13,424 |
wandb | wandb/sdk/lib/module.py | .py | #
import wandb
from . import preinit
def set_global(
run=None,
config=None,
log=None,
summary=None,
save=None,
use_artifact=None,
log_artifact=None,
define_metric=None,
alert=None,
mark_preempting=None,
log_model=None,
use_model=None,
link_model=None,
watch=Non... | 73 | 1,916 |
wandb | wandb/sdk/lib/run_moment.py | .py | from __future__ import annotations
from dataclasses import dataclass
from urllib import parse
@dataclass
class RunMoment:
"""A moment in a run.
Defines a branching point in a finished run to fork or resume from.
A run moment is identified by a run ID and a metric value.
Currently, only the metric '_... | 82 | 2,388 |
wandb | wandb/sdk/lib/logger_capture.py | .py | from __future__ import annotations
import logging
from typing_extensions import override
import wandb
class LoggerHandler(logging.Handler):
"""A logging.Handler that forwards log records using `run.write_logs()`."""
def __init__(
self,
run: wandb.Run,
level: int | str = logging.NOT... | 28 | 685 |
wandb | wandb/sdk/lib/redirect.py | .py | from __future__ import annotations
try:
import fcntl
import pty
import termios
import tty
except ImportError: # windows
pty = tty = termios = fcntl = None # type: ignore
import itertools
import logging
import os
import queue
import re
import signal
import struct
import sys
import threading
impor... | 872 | 27,330 |
wandb | wandb/sdk/lib/urls.py | .py | """Validation for URLs."""
from pydantic_core import SchemaValidator, core_schema
_URL_VALIDATOR = SchemaValidator(
core_schema.url_schema(
allowed_schemes=["http", "https"],
strict=True,
)
)
def validate_url(url: object) -> None:
"""Validate a URL.
Args:
url: The URL to val... | 27 | 587 |
wandb | wandb/sdk/lib/proto_util.py | .py | #
from __future__ import annotations
import json
from typing import TYPE_CHECKING, Any
from wandb.proto import wandb_internal_pb2 as pb
if TYPE_CHECKING: # pragma: no cover
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
from google.protobuf.message import Message
from w... | 85 | 2,684 |
wandb | wandb/sdk/lib/runid.py | .py | """runid util."""
import os
import random
import secrets
from string import ascii_lowercase, digits
_ID_CHARS = f"{ascii_lowercase}{digits}"
# Create a dedicated Random instance with its own state so it
# is not affected by global random.seed() calls
_random = random.Random()
# Reset the random number generator on... | 39 | 1,407 |
wandb | wandb/sdk/lib/json_util.py | .py | """JSON helpers backed by pydantic-core, with stdlib fallback.
The wrapper mirrors the stdlib `json` surface (`dumps`/`dump`/`loads`/`load`)
and routes the hot path through `pydantic_core` for speed. Anything pydantic
cannot do — unrecognized kwargs, unserializable objects without a fallback,
etc. — is caught and re-t... | 55 | 1,697 |
wandb | wandb/sdk/lib/asyncio_compat.py | .py | """Functions for compatibility with asyncio."""
from __future__ import annotations
import asyncio
import concurrent
import concurrent.futures
import contextlib
import threading
from collections.abc import AsyncGenerator, Callable, Coroutine
from typing import Any, TypeVar
_T = TypeVar("_T")
def run(fn: Callable[[]... | 293 | 9,751 |
wandb | wandb/sdk/lib/identity.py | .py | """Resolving session credentials to the account they belong to."""
from __future__ import annotations
import dataclasses
import logging
from typing import TYPE_CHECKING, Any
from wandb.sdk.lib.json_util import loads
if TYPE_CHECKING:
from wandb.sdk.wandb_settings import Settings
_logger = logging.getLogger(__n... | 102 | 3,119 |
wandb | wandb/sdk/lib/run_stopping.py | .py | """Stopping a run if requested by wandb-core.
A run can be stopped manually through the UI or automatically after
a fatal upload error (if configured). "Stopping" a run means killing
its script.
"""
from __future__ import annotations
import asyncio
import contextlib
import time
from collections.abc import Callable
... | 118 | 3,458 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.