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/data_types/eval_table.py | .py | from __future__ import annotations
import datetime
from collections.abc import Iterator
from typing import TYPE_CHECKING, Any
from typing_extensions import override
import wandb
import wandb.integration.weave as weave_integration
import wandb.integration.weave.media_adapters as media_adapters
from wandb.errors impor... | 487 | 18,147 |
wandb | wandb/sdk/data_types/graph.py | .py | import codecs
import os
import pprint
from wandb import util
from wandb.sdk.data_types._private import MEDIA_TMP
from wandb.sdk.data_types.base_types.media import Media, _numpy_arrays_to_lists
from wandb.sdk.data_types.base_types.wb_value import WBValue
from wandb.sdk.lib import runid
def _nest(thing):
# Use ten... | 440 | 12,751 |
wandb | wandb/sdk/data_types/base_types/media.py | .py | from __future__ import annotations
import hashlib
import os
import pathlib
import re
import shutil
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any, cast
import wandb
from wandb import util
from wandb.sdk.lib import filesystem
from wandb.sdk.lib.paths import LogicalPath
from .wb_value impor... | 345 | 12,640 |
wandb | wandb/sdk/data_types/base_types/wb_value.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING, Any, ClassVar
from wandb import util
from wandb.sdk import wandb_setup
if TYPE_CHECKING: # pragma: no cover
from wandb.sdk.artifacts.artifact import Artifact
from ...wandb_run import Run as LocalRun
TypeMappingType = dict[str, type["... | 292 | 11,592 |
wandb | wandb/sdk/data_types/base_types/json_metadata.py | .py | from __future__ import annotations
import codecs
import os
from typing import TYPE_CHECKING
from wandb import util
from wandb.sdk.lib import runid
from .._private import MEDIA_TMP
from .media import Media
if TYPE_CHECKING: # pragma: no cover
from wandb.sdk.artifacts.artifact import Artifact
from ...wandb_... | 58 | 1,564 |
wandb | wandb/sdk/data_types/helper_types/bounding_boxes_2d.py | .py | from __future__ import annotations
import numbers
from typing import TYPE_CHECKING
import wandb
from wandb import util
from wandb.util import has_num
from ..base_types.json_metadata import JSONMetadata
if TYPE_CHECKING: # pragma: no cover
from wandb.sdk.artifacts.artifact import Artifact
from ...wandb_run... | 330 | 13,765 |
wandb | wandb/sdk/data_types/helper_types/image_mask.py | .py | from __future__ import annotations
import numbers
import os
from typing import TYPE_CHECKING
import wandb
from wandb import util
from wandb.sdk.lib import runid
from .._private import MEDIA_TMP
from ..base_types.media import Media
if TYPE_CHECKING: # pragma: no cover
from wandb.sdk.artifacts.artifact import Ar... | 254 | 8,845 |
wandb | wandb/sdk/data_types/helper_types/classes.py | .py | from __future__ import annotations
import os
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any
from .. import _dtypes
from ..base_types.media import Media
if TYPE_CHECKING: # pragma: no cover
from wandb.sdk.artifacts.artifact import Artifact
from ...wandb_run import Run as LocalRun... | 163 | 5,496 |
wandb | wandb/apis/normalize.py | .py | """normalize."""
from __future__ import annotations
import ast
import sys
from collections.abc import Callable
from functools import wraps
from typing import TypeVar, cast
from wandb import env
from wandb.errors import CommError, Error
from wandb.sdk.lib.service.service_connection import WandbApiFailedError
from wan... | 73 | 2,262 |
wandb | wandb/apis/__init__.py | .py | """api."""
from __future__ import annotations
from collections.abc import Callable
import wandb
from wandb import env, util
def _disable_ssl() -> Callable[[], None]:
import requests
from urllib3.exceptions import InsecureRequestWarning
# Because third party libraries may also use requests, we monkey p... | 51 | 1,391 |
wandb | wandb/apis/paginator.py | .py | from __future__ import annotations
import json
from abc import ABC, abstractmethod
from collections.abc import Callable, Iterable, Iterator, Mapping, Sized
from typing import TYPE_CHECKING, Any, ClassVar, Generic, TypeVar, overload
import wandb
from wandb._strutils import nameof
if TYPE_CHECKING:
from wandb._pyd... | 236 | 7,980 |
wandb | wandb/apis/internal.py | .py | from __future__ import annotations
from typing import Any
from wandb.sdk.internal.internal_api import Api as InternalApi
class Api:
"""Internal proxy to the official internal API."""
# TODO: Move these methods to PublicApi.
def __init__(self, *args: Any, **kwargs: Any) -> None:
self._api_args ... | 218 | 6,827 |
wandb | wandb/apis/attrs.py | .py | from __future__ import annotations
from collections.abc import Mapping
from typing import Any
import wandb
from ..sdk.lib import ipython
class Attrs:
def __init__(self, attrs: Mapping[str, Any]):
self._attrs = dict(attrs)
def snake_to_camel(self, string):
camel = "".join([i.title() for i i... | 54 | 1,477 |
wandb | wandb/apis/workspaces/__init__.py | .py | import wandb
try:
from wandb_workspaces.workspaces import * # noqa: F403
except ImportError:
wandb.termerror(
"Failed to import wandb_workspaces. To edit workspaces programmatically, please install it using `pip install wandb[workspaces]`."
)
| 9 | 265 |
wandb | wandb/apis/reports/v2/__init__.py | .py | import wandb
try:
from wandb_workspaces.reports.v2 import * # noqa: F403
except ImportError:
wandb.termerror(
"Failed to import wandb_workspaces. To edit reports programmatically, please install it using `pip install wandb[workspaces]`."
)
| 9 | 263 |
wandb | wandb/apis/reports/v1/__init__.py | .py | import wandb
try:
from wandb_workspaces.reports.v1 import * # noqa: F403
except ImportError:
wandb.termerror(
"Failed to import wandb_workspaces. To edit reports programmatically, please install it using `pip install wandb[workspaces]`."
)
| 9 | 263 |
wandb | wandb/apis/_generated/create_team.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLId, GQLResult
class CreateTeam(GQLResult):
result: CreateTeamResult | None
class CreateTeamResult(GQLResult):
entity: CreateTeamResultEntity | N... | 29 | 559 |
wandb | wandb/apis/_generated/get_sweep_agent.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import AgentFragment
class GetSweepAgent(GQLResult):
project: GetSweepAgentProject | None
class GetSweepAgentProject(GQLResult):
sweep: GetSweepAgen... | 26 | 530 |
wandb | wandb/apis/_generated/operations.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
__all__ = [
"CREATE_INVITE_GQL",
"CREATE_PROJECT_GQL",
"CREATE_SERVICE_ACCOUNT_GQL",
"CREATE_TEAM_GQL",
"CREATE_USER_FROM_ADMIN_GQL",
"DELETE_API_KEY_GQL",
"DELETE_INVITE_GQL",
"GENERATE_API_KEY_GQL",
"GET_AGENT_RUN... | 574 | 8,795 |
wandb | wandb/apis/_generated/get_project.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import ProjectFragment
class GetProject(GQLResult):
project: ProjectFragment | None
GetProject.model_rebuild()
| 16 | 279 |
wandb | wandb/apis/_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 ArtifactTypeInput(GQLInput):
description: str | None = None
name: str = Field(max_length=128, pattern="^[-\... | 67 | 2,447 |
wandb | wandb/apis/_generated/create_service_account.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLId, GQLResult
class CreateServiceAccount(GQLResult):
result: CreateServiceAccountResult | None
class CreateServiceAccountResult(GQLResult):
user: CreateServiceAccountResult... | 23 | 479 |
wandb | wandb/apis/_generated/create_project.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import CreatedProjectFragment
class CreateProject(GQLResult):
result: CreateProjectResult | None
class CreateProjectResult(GQLResult):
project: Crea... | 23 | 481 |
wandb | wandb/apis/_generated/search_users.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import UserFragment
class SearchUsers(GQLResult):
users: SearchUsersUsers | None
class SearchUsersUsers(GQLResult):
edges: list[SearchUsersUsersEdge... | 26 | 496 |
wandb | wandb/apis/_generated/fragments.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from typing import Literal
from pydantic import Field
from wandb._pydantic import GQLId, GQLResult, Typename
class AgentFragment(GQLResult):
id: GQLId
name: str
host: str
state: str | None
to... | 154 | 3,895 |
wandb | wandb/apis/_generated/__init__.py | .py | # Generated by ariadne-codegen
__all__ = [
"CREATE_INVITE_GQL",
"CREATE_PROJECT_GQL",
"CREATE_SERVICE_ACCOUNT_GQL",
"CREATE_TEAM_GQL",
"CREATE_USER_FROM_ADMIN_GQL",
"DELETE_API_KEY_GQL",
"DELETE_INVITE_GQL",
"GENERATE_API_KEY_GQL",
"GET_AGENT_RUNS_GQL",
"GET_DEFAULT_ENTITY_GQL",... | 123 | 3,170 |
wandb | wandb/apis/_generated/get_team_entity.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLId, GQLResult
class GetTeamEntity(GQLResult):
entity: GetTeamEntityEntity | None
class GetTeamEntityEntity(GQLResult):
id: GQLId
name: str
... | 46 | 1,327 |
wandb | wandb/apis/_generated/get_sweeps.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import PageInfoFragment, SweepFragment
class GetSweeps(GQLResult):
project: GetSweepsProject | None
class GetSweepsProject(G... | 35 | 786 |
wandb | wandb/apis/_generated/get_projects.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import PageInfoFragment, ProjectFragment
class GetProjects(GQLResult):
models: GetProjectsModels | None
class GetProjectsMod... | 29 | 613 |
wandb | wandb/apis/_generated/delete_invite.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
class DeleteInvite(GQLResult):
result: DeleteInviteResult | None
class DeleteInviteResult(GQLResult):
success: bool | None
DeleteInvite.model_rebuild()
| 18 | 309 |
wandb | wandb/apis/_generated/get_sweep_legacy.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import LegacySweepFragment
class GetSweepLegacy(GQLResult):
project: GetSweepLegacyProject | None
class GetSweepLegacyProject(GQLResult):
sweep: Leg... | 21 | 415 |
wandb | wandb/apis/_generated/get_viewer.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import UserFragment
class GetViewer(GQLResult):
viewer: UserFragment | None
GetViewer.model_rebuild()
| 16 | 270 |
wandb | wandb/apis/_generated/get_agent_runs.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import LightweightRunFragment, PageInfoFragment
class GetAgentRuns(GQLResult):
project: GetAgentRunsProject | None
class Get... | 45 | 1,114 |
wandb | wandb/apis/_generated/get_sweep_agents.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import AgentFragment
class GetSweepAgents(GQLResult):
project: GetSweepAgentsProject | None
class GetSweepAgentsProject(GQLResult):
sweep: GetSweepA... | 36 | 844 |
wandb | wandb/apis/_generated/generate_api_key.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
from .fragments import ApiKeyFragment
class GenerateApiKey(GQLResult):
result: GenerateApiKeyResult | None
class GenerateApiKeyResult(GQLRes... | 23 | 455 |
wandb | wandb/apis/_generated/get_default_entity.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLId, GQLResult
class GetDefaultEntity(GQLResult):
viewer: GetDefaultEntityViewer | None
class GetDefaultEntityViewer(GQLResult):
id: GQLId
entity: str | None
GetDefaul... | 19 | 344 |
wandb | wandb/apis/_generated/is_project_read_only.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLResult
class IsProjectReadOnly(GQLResult):
project: IsProjectReadOnlyProject | None
class IsProjectReadOnlyProject(GQLResult):
read_only: bool |... | 20 | 388 |
wandb | wandb/apis/_generated/create_invite.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from pydantic import Field
from wandb._pydantic import GQLId, GQLResult
class CreateInvite(GQLResult):
result: CreateInviteResult | None
class CreateInviteResult(GQLResult):
invite: CreateInviteResultIn... | 34 | 728 |
wandb | wandb/apis/_generated/get_sweep.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import SweepFragment
class GetSweep(GQLResult):
project: GetSweepProject | None
class GetSweepProject(GQLResult):
sweep: SweepFragment | None
GetS... | 21 | 373 |
wandb | wandb/apis/_generated/create_user_from_admin.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
from .fragments import UserInfoFragment
class CreateUserFromAdmin(GQLResult):
result: CreateUserFromAdminResult | None
class CreateUserFromAdminResult(GQLResult):
u... | 21 | 429 |
wandb | wandb/apis/_generated/delete_api_key.py | .py | # Generated by ariadne-codegen
# Source: tools/graphql_codegen/api/
from __future__ import annotations
from wandb._pydantic import GQLResult
class DeleteApiKey(GQLResult):
result: DeleteApiKeyResult | None
class DeleteApiKeyResult(GQLResult):
success: bool | None
DeleteApiKey.model_rebuild()
| 18 | 309 |
wandb | wandb/apis/public/query_generator.py | .py | from __future__ import annotations
class QueryGenerator:
"""QueryGenerator is a helper object to write filters for runs."""
INDIVIDUAL_OP_TO_MONGO = {
"!=": "$ne",
">": "$gt",
">=": "$gte",
"<": "$lt",
"<=": "$lte",
"IN": "$in",
"NIN": "$nin",
"... | 177 | 6,507 |
wandb | wandb/apis/public/reports.py | .py | """W&B Public API for Report objects.
This module provides classes for interacting with W&B reports and
managing report-related data.
"""
from __future__ import annotations
import ast
import json
import re
import urllib
from typing import TYPE_CHECKING, Any
import wandb
from wandb._strutils import nameof
from wandb... | 629 | 20,679 |
wandb | wandb/apis/public/files.py | .py | """W&B Public API for File objects.
This module provides classes for interacting with files stored in W&B.
Example:
```python
from wandb.apis.public import Api
# Get files from a specific run
run = Api().run("entity/project/run_id")
files = run.files()
# Work with files
for file in files:
print(f"File: {file.na... | 387 | 12,417 |
wandb | wandb/apis/public/utils.py | .py | from __future__ import annotations
import re
from enum import Enum
from urllib.parse import urlparse
from wandb._iterutils import one
from wandb.sdk.internal.internal_api import Api as InternalApi
def parse_s3_url_to_s3_uri(url) -> str:
"""Convert an S3 HTTP(S) URL to an S3 URI.
Arguments:
url (str... | 107 | 3,691 |
wandb | wandb/apis/public/runs.py | .py | """W&B Public API for Runs.
This module provides classes for interacting with W&B runs and their associated
data.
Example:
```python
from wandb.apis.public import Api
# Get runs matching filters
runs = Api().runs(
path="entity/project", filters={"state": "finished", "config.batch_size": 32}
)
# Access run data
... | 1,786 | 63,005 |
wandb | wandb/apis/public/organizations.py | .py | """W&B Public API for reading organizations."""
from __future__ import annotations
from dataclasses import KW_ONLY, InitVar
from typing import Literal
from pydantic import ConfigDict
from pydantic.alias_generators import to_camel
from pydantic.dataclasses import dataclass as pydantic_dataclass
from wandb._pydantic ... | 51 | 1,469 |
wandb | wandb/apis/public/service_api.py | .py | from __future__ import annotations
import json
import logging
from collections.abc import Callable, Iterable, Mapping
from dataclasses import dataclass
from typing import Any, TypeVar, cast
from wandb.proto import wandb_internal_pb2 as pb
from wandb.proto import wandb_server_pb2 as spb
from wandb.proto.wandb_api_pb2 ... | 344 | 12,384 |
wandb | wandb/apis/public/__init__.py | .py | __all__ = (
"Api",
"ArtifactCollection",
"ArtifactCollections",
"ProjectArtifactCollections",
"ArtifactFiles",
"Artifacts",
"ArtifactType",
"ArtifactTypes",
"DownloadHistoryResult",
"RunArtifacts",
"Automations", # doc:exclude
"File",
"Files",
"HistoryScan", # d... | 92 | 2,488 |
wandb | wandb/apis/public/users.py | .py | """W&B Public API for managing users and API keys.
This module provides classes for managing W&B users and their API keys.
Note:
This module is part of the W&B Public API and provides methods to manage
users and their authentication. Some operations require admin privileges.
"""
from __future__ import annota... | 177 | 5,756 |
wandb | wandb/apis/public/jobs.py | .py | """W&B Public API for management Launch Jobs and Launch Queues.
This module provides classes for managing W&B jobs, queued runs, and run
queues.
"""
from __future__ import annotations
import json
import os
import shutil
import time
from collections.abc import Callable, Mapping
from typing import TYPE_CHECKING, Any, ... | 779 | 28,276 |
wandb | wandb/apis/public/sweeps.py | .py | """W&B Public API for Sweeps.
This module provides classes for interacting with W&B hyperparameter
optimization sweeps.
Example:
```python
from wandb.apis.public import Api
# Get a specific sweep
sweep = Api().sweep("entity/project/sweep_id")
# Access sweep properties
print(f"Sweep: {sweep.name}")
print(f"State: {s... | 631 | 19,981 |
wandb | wandb/apis/public/integrations.py | .py | """W&B Public API for integrations.
This module provides classes for interacting with W&B integrations.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, ClassVar, TypeVar
from typing_extensions import override
from wandb.apis.paginator import RelayPaginator
if TYPE_CHECKING:
from ... | 96 | 3,388 |
wandb | wandb/apis/public/automations.py | .py | """W&B Public API for Automation objects."""
from __future__ import annotations
from collections.abc import Iterator, Mapping
from typing import TYPE_CHECKING, Any, ClassVar, TypeAlias
from pydantic import ValidationError
from typing_extensions import override
from wandb.apis.paginator import RelayPaginator
if TYP... | 214 | 6,853 |
wandb | wandb/apis/public/projects.py | .py | """W&B Public API for Project objects.
This module provides classes for interacting with W&B projects and their
associated data.
Example:
```python
from wandb.apis.public import Api
# Get all projects for an entity
projects = Api().projects("entity")
# Access project data
for project in projects:
print(f"Projec... | 304 | 9,665 |
wandb | wandb/apis/public/artifacts.py | .py | """W&B Public API for Artifact objects.
This module provides classes for interacting with W&B artifacts and their
collections.
"""
from __future__ import annotations
from collections.abc import Collection, Iterable, Mapping, Sequence
from copy import copy
from functools import lru_cache
from typing import ( # noqa:... | 1,216 | 41,817 |
wandb | wandb/apis/public/history.py | .py | """W&B Public API for Run History.
This module provides classes for efficiently scanning and sampling run
history data.
Note:
This module is part of the W&B Public API and provides methods
to access run history data. It handles pagination automatically and offers
both complete and sampled access to metric... | 146 | 4,793 |
wandb | wandb/apis/public/api.py | .py | """Use the Public API to export or update data that you have saved to W&B.
Before using this API, you'll want to log data from your script — check the
[Quickstart](https://docs.wandb.ai/models/quickstart) for more details.
You might use the Public API to
- update metadata or metrics for an experiment after it has be... | 2,659 | 96,183 |
wandb | wandb/apis/public/summary.py | .py | import os
import time
import wandb
from wandb import util
from wandb.apis.internal import Api
from wandb.sdk.data_types.utils import val_to_json
DEEP_SUMMARY_FNAME = "wandb.h5"
H5_TYPES = ("numpy.ndarray", "tensorflow.Tensor", "torch.Tensor")
h5py = util.get_module("h5py")
class SummarySubDict:
"""Nested dict-l... | 406 | 12,930 |
wandb | wandb/apis/public/teams.py | .py | """W&B Public API for managing teams and team members.
This module provides classes for managing W&B teams and their members.
Note:
This module is part of the W&B Public API and provides methods to manage
teams and their members. Team management operations require appropriate
permissions.
"""
from __futu... | 202 | 6,167 |
wandb | wandb/apis/public/runhistory/__init__.py | .py | __all__ = (
"DownloadHistoryResult",
"IncompleteRunHistoryError",
"wait_for_download_with_progress",
)
from .downloads import (
DownloadHistoryResult,
IncompleteRunHistoryError,
wait_for_download_with_progress,
)
| 12 | 238 |
wandb | wandb/apis/public/runhistory/downloads.py | .py | from __future__ import annotations
import asyncio
import pathlib
import time
from dataclasses import dataclass
from wandb.apis.public.service_api import ServiceApi
from wandb.proto import wandb_api_pb2 as apb
from wandb.sdk.lib import asyncio_compat
from wandb.sdk.lib.printer import new_printer
from wandb.sdk.lib.pro... | 139 | 4,906 |
wandb | wandb/apis/public/registries/_utils.py | .py | from __future__ import annotations
import logging
from collections.abc import Collection
from enum import Enum
from functools import lru_cache
from typing import TYPE_CHECKING, Any, TypeVar, overload
from wandb._strutils import b64decode_ascii, ensureprefix, repr_join
from wandb.proto import wandb_internal_pb2 as pb
... | 235 | 7,903 |
wandb | wandb/apis/public/registries/_freezable_list.py | .py | from __future__ import annotations
from collections.abc import Iterable, Iterator, MutableSequence, Sequence
from itertools import chain
from typing import Any, TypeVar, overload
from wandb._strutils import nameof
T = TypeVar("T")
class FreezableList(MutableSequence[T]):
"""A list-like container type that only... | 169 | 6,299 |
wandb | wandb/apis/public/registries/_members.py | .py | """Types and helpers for managing registry members."""
from __future__ import annotations
from collections import defaultdict
from collections.abc import Iterable
from enum import Enum
from functools import singledispatchmethod
from typing import Literal, Union
from pydantic.dataclasses import dataclass as pydantic_... | 112 | 3,374 |
wandb | wandb/apis/public/registries/__init__.py | .py | __all__ = [
"Registry", # doc:exclude
"Registries", # doc:exclude
]
from .registries_search import Registries
from .registry import Registry
| 8 | 152 |
wandb | wandb/apis/public/registries/registry.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal
from pydantic import PositiveInt
from typing_extensions import Self, assert_never
import wandb
from wandb._analytics import tracked
from wandb._strutils import nameof
from wandb.apis.public.teams import Team
from wandb.apis.public.user... | 718 | 25,482 |
wandb | wandb/apis/public/registries/registries_search.py | .py | """Public API: registries search."""
from __future__ import annotations
from collections.abc import Iterator
from itertools import chain
from typing import TYPE_CHECKING, Annotated, Any, ClassVar, Protocol, TypeAlias, TypeVar
from pydantic import AfterValidator, PositiveInt, ValidationError
from typing_extensions im... | 637 | 22,647 |
wandb | wandb/integration/diffusers/__init__.py | .py | from .autologger import autolog
__all__ = ["autolog"]
| 4 | 55 |
wandb | wandb/integration/diffusers/autologger.py | .py | import logging
from wandb.sdk.integration_utils.auto_logging import AutologAPI
from .pipeline_resolver import DiffusersPipelineResolver
logger = logging.getLogger(__name__)
autolog = AutologAPI(
name="diffusers",
symbols=(
"DiffusionPipeline.__call__",
"AutoPipelineForText2Image.__call__",
... | 77 | 3,254 |
wandb | wandb/integration/diffusers/pipeline_resolver.py | .py | from collections.abc import Sequence
from typing import Any
from wandb.sdk.integration_utils.auto_logging import Response
from .resolvers import (
SUPPORTED_MULTIMODAL_PIPELINES,
DiffusersMultiModalPipelineResolver,
)
class DiffusersPipelineResolver:
"""Resolver for `DiffusionPipeline` request and respo... | 52 | 1,855 |
wandb | wandb/integration/diffusers/resolvers/multimodal.py | .py | import logging
from collections.abc import Sequence
from typing import Any
import wandb
from wandb.sdk.integration_utils.auto_logging import Response
from .utils import (
chunkify,
decode_sdxl_t2i_latents,
get_updated_kwargs,
postprocess_np_arrays_for_video,
postprocess_pils_to_np,
)
logger = log... | 883 | 30,005 |
wandb | wandb/integration/diffusers/resolvers/utils.py | .py | from __future__ import annotations
import inspect
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any
import wandb
from wandb.util import get_module
if TYPE_CHECKING:
np_array = get_module("numpy.array")
torch_float_tensor = get_module("torch.FloatTensor")
def chunkify(input_list, ch... | 105 | 3,842 |
wandb | wandb/integration/diffusers/resolvers/__init__.py | .py | from .multimodal import (
SUPPORTED_MULTIMODAL_PIPELINES,
DiffusersMultiModalPipelineResolver,
)
__all__ = [
"SUPPORTED_MULTIMODAL_PIPELINES",
"DiffusersMultiModalPipelineResolver",
]
| 10 | 201 |
wandb | wandb/integration/ultralytics/callback.py | .py | from __future__ import annotations
import copy
from collections.abc import Callable
from datetime import datetime
from packaging import version
try:
import dill as pickle
except ImportError:
import pickle
import wandb
from wandb.sdk.lib import telemetry
try:
import torch
import ultralytics
from... | 531 | 21,346 |
wandb | wandb/integration/ultralytics/mask_utils.py | .py | from __future__ import annotations
import cv2
import numpy as np
from tqdm.auto import tqdm
from ultralytics.engine.results import Results
from ultralytics.models.yolo.segment import SegmentationPredictor
from ultralytics.utils.ops import scale_image
import wandb
from wandb.integration.ultralytics.bbox_utils import (... | 203 | 7,068 |
wandb | wandb/integration/ultralytics/__init__.py | .py | """Tools for integrating with [`ultralytics`](https://docs.ultralytics.com/).
Ultralytics is a computer vision framework for training and deploying YOLOv8 models.
"""
from wandb.integration.ultralytics.callback import (
WandBUltralyticsCallback,
add_wandb_callback,
)
__all__ = ("WandBUltralyticsCallback", "a... | 12 | 340 |
wandb | wandb/integration/ultralytics/bbox_utils.py | .py | from __future__ import annotations
from typing import Any
import torch
from tqdm.auto import tqdm
from ultralytics.engine.results import Results
from ultralytics.models.yolo.detect import DetectionPredictor
from ultralytics.utils import ops
import wandb
def scale_bounding_box_to_original_image_shape(
box: torc... | 218 | 8,046 |
wandb | wandb/integration/ultralytics/pose_utils.py | .py | from __future__ import annotations
from typing import Any
import numpy as np
from PIL import Image
from tqdm.auto import tqdm
from ultralytics.engine.results import Results
from ultralytics.models.yolo.pose import PosePredictor
from ultralytics.utils.plotting import Annotator
import wandb
from wandb.integration.ultr... | 106 | 3,729 |
wandb | wandb/integration/ultralytics/classification_utils.py | .py | from __future__ import annotations
from typing import Any
import numpy as np
from tqdm.auto import tqdm
from ultralytics.engine.results import Results
from ultralytics.models.yolo.classify import ClassificationPredictor
import wandb
def plot_classification_predictions(
result: Results,
model_name: str,
... | 86 | 3,185 |
wandb | wandb/integration/gym/__init__.py | .py | from __future__ import annotations
import re
from typing import Literal
import wandb
import wandb.util
_gym_version_lt_0_26: bool | None = None
_gymnasium_version_lt_1_0_0: bool | None = None
_required_error_msg = (
"Couldn't import the gymnasium python package, install with `pip install gymnasium`"
)
GymLib = ... | 100 | 3,000 |
wandb | wandb/integration/prodigy/__init__.py | .py | from .prodigy import upload_dataset
__all__ = ["upload_dataset"]
| 4 | 66 |
wandb | wandb/integration/prodigy/prodigy.py | .py | """Prodigy integration for W&B.
User can upload Prodigy annotated datasets directly
from the local database to W&B in Tables format.
Example usage:
```python
import wandb
from wandb.integration.prodigy import upload_dataset
run = wandb.init(project="prodigy")
upload_dataset("name_of_dataset")
wandb.finish()
```
"""... | 285 | 11,131 |
wandb | wandb/integration/tensorflow/estimator_hook.py | .py | import tensorflow as tf
import wandb
from wandb.sdk.lib import telemetry
if hasattr(tf.estimator, "SessionRunHook"):
# In tf 1.14 and beyond, SessionRunHook is in the estimator package.
SessionRunHook = tf.estimator.SessionRunHook
SessionRunArgs = tf.estimator.SessionRunArgs
else:
# In older versions ... | 55 | 1,756 |
wandb | wandb/integration/tensorflow/__init__.py | .py | """api."""
from wandb.integration.tensorboard import log
from .estimator_hook import WandbHook
| 6 | 97 |
wandb | wandb/integration/lightgbm/__init__.py | .py | """W&B callback for lightgbm.
Really simple callback to get logging for each tree
Example usage:
param_list = [("eta", 0.08), ("max_depth", 6), ("subsample", 0.8), ("colsample_bytree", 0.8), ("alpha", 8), ("num_class", 10)]
config.update(dict(param_list))
lgb = lgb.train(param_list, d_train, callbacks=[wandb_callbac... | 243 | 8,005 |
wandb | wandb/integration/sagemaker/files.py | .py | SM_PARAM_CONFIG = "/opt/ml/input/config/hyperparameters.json"
SM_SECRETS = "secrets.env"
| 3 | 89 |
wandb | wandb/integration/sagemaker/__init__.py | .py | """wandb integration sagemaker module."""
from .auth import sagemaker_auth
from .config import is_using_sagemaker, parse_sm_config
from .resources import parse_sm_secrets, set_global_settings, set_run_id
__all__ = [
"sagemaker_auth",
"is_using_sagemaker",
"parse_sm_config",
"parse_sm_secrets",
"se... | 15 | 360 |
wandb | wandb/integration/sagemaker/auth.py | .py | from __future__ import annotations
import os
from typing import Any
from wandb import env
from wandb.sdk import wandb_setup
from wandb.sdk.lib import wbauth
def sagemaker_auth(
overrides: dict[str, Any] | None = None,
path: str = ".",
api_key: str | None = None,
) -> None:
"""Write a secrets.env fil... | 41 | 1,124 |
wandb | wandb/integration/sagemaker/config.py | .py | from __future__ import annotations
import json
import os
import re
import warnings
from typing import Any
from . import files as sm_files
def is_using_sagemaker() -> bool:
"""Returns whether we're in a SageMaker environment."""
return (
os.path.exists(sm_files.SM_PARAM_CONFIG) #
or "SM_TRAI... | 59 | 1,748 |
wandb | wandb/integration/sagemaker/resources.py | .py | from __future__ import annotations
import os
import secrets
import socket
import string
import wandb
from . import config
from . import files as sm_files
def set_run_id(run_settings: wandb.Settings) -> bool:
"""Set a run ID and group when using SageMaker.
Returns whether the ID and group were updated.
... | 64 | 1,944 |
wandb | wandb/integration/kfp/wandb_log_v1.py | .py | def wandb_log( # noqa: C901
func=None,
# /, # py38 only
log_component_file=True,
):
"""Wrap a kfp v1 python functional component and log to W&B.
Requires kfp<2.0.0. Deprecated -- please upgrade to kfp>=2.0.0.
"""
import json
import os
from functools import wraps
from inspect i... | 197 | 6,768 |
wandb | wandb/integration/kfp/_patch_utils.py | .py | from __future__ import annotations
from collections.abc import Callable
import wandb
def full_path_exists(full_func: str) -> bool:
"""Return True if every component in a dotted path exists as a module attribute.
Args:
full_func: A dotted path such as `kfp.dsl.component_factory.create_component_from... | 68 | 2,257 |
wandb | wandb/integration/kfp/_kfp_v2_patch.py | .py | """KFP v2 monkey-patch functions for `kfp.dsl.component_factory`.
These replace three functions in the `component_factory` module so that
`@wandb_log`-decorated components automatically include W&B logging at
container runtime. Module-level state (`_orig_create`, `_orig_get_cmd`,
`_wandb_logging_extras`) is set by `kf... | 115 | 3,658 |
wandb | wandb/integration/kfp/__init__.py | .py | from __future__ import annotations
__all__ = ["wandb_log", "unpatch_kfp"]
from collections.abc import Callable
from typing import TYPE_CHECKING, Any
from .kfp_patch import patch_kfp, unpatch_kfp
if TYPE_CHECKING:
from typing import ParamSpec, TypeVar, overload
_P = ParamSpec("_P")
_T = TypeVar("_T")
... | 67 | 1,591 |
wandb | wandb/integration/kfp/wandb_log_v2.py | .py | from __future__ import annotations
import os
from collections.abc import Callable
from functools import wraps
from inspect import signature
from typing import Any
import kfp.dsl
from kfp.dsl.types.type_annotations import (
InputPath,
OutputPath,
is_artifact_wrapped_in_Input,
is_artifact_wrapped_in_Out... | 262 | 8,656 |
wandb | wandb/integration/kfp/helpers.py | .py | import json
def add_wandb_visualization(run, mlpipeline_ui_metadata_path):
"""NOTE: To use this, you must modify your component to have an output called `mlpipeline_ui_metadata_path` AND call `wandb.init` yourself inside that component.
Example usage:
def my_component(..., mlpipeline_ui_metadata_path: O... | 29 | 1,016 |
wandb | wandb/integration/kfp/kfp_patch.py | .py | from __future__ import annotations
import inspect
import itertools
import textwrap
from collections.abc import Callable, Mapping
import wandb
from ._patch_utils import patch, unpatch
try:
from kfp import __version__ as kfp_version
from packaging.version import parse
_KFP_V2 = parse(kfp_version) >= pars... | 301 | 9,107 |
wandb | wandb/integration/metaflow/errors.py | .py | import wandb
class MissingDependencyError(Exception):
"""An optional dependency is missing."""
def __init__(self, *args: object, warning: str) -> None:
super().__init__(*args)
self._wb_warning = warning
def warn(self) -> None:
"""Print a warning for the problem."""
wandb.... | 14 | 347 |
wandb | wandb/integration/metaflow/metaflow.py | .py | from __future__ import annotations
import inspect
import pickle
from functools import wraps
from pathlib import Path
import wandb
from wandb.sdk.lib import telemetry as wb_telemetry
from . import errors
try:
from metaflow import current
except ImportError as e:
raise Exception(
"Error: `metaflow` no... | 328 | 9,360 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.