id
int64
1
6.07M
name
stringlengths
1
295
code
stringlengths
12
426k
language
stringclasses
1 value
source_file
stringlengths
5
202
start_line
int64
1
158k
end_line
int64
1
158k
repo
dict
4,301
run_resume_status
def run_resume_status( self, entity: str, project_name: str, name: str ) -> Optional[Dict[str, Any]]: """Check if a run exists and get resume information. Arguments: entity (str): The entity to scope this project to. project_name (str): The project to download, (can ...
python
wandb/sdk/internal/internal_api.py
937
994
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,302
check_stop_requested
def check_stop_requested( self, project_name: str, entity_name: str, run_id: str ) -> bool: query = gql( """ query RunStoppedStatus($projectName: String, $entityName: String, $runId: String!) { project(name:$projectName, entityName:$entityName) { run(n...
python
wandb/sdk/internal/internal_api.py
997
1,029
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,303
format_project
def format_project(self, project: str) -> str: return re.sub(r"\W+", "-", project.lower()).strip("-_")
python
wandb/sdk/internal/internal_api.py
1,031
1,032
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,304
upsert_project
def upsert_project( self, project: str, id: Optional[str] = None, description: Optional[str] = None, entity: Optional[str] = None, ) -> Dict[str, Any]: """Create a new project. Arguments: project (str): The project to create descriptio...
python
wandb/sdk/internal/internal_api.py
1,035
1,073
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,305
entity_is_team
def entity_is_team(self, entity: str) -> bool: query = gql( """ query EntityIsTeam($entity: String!) { entity(name: $entity) { id isTeam } } """ ) variable_values = { ...
python
wandb/sdk/internal/internal_api.py
1,076
1,099
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,306
get_project_run_queues
def get_project_run_queues(self, entity: str, project: str) -> List[Dict[str, str]]: query = gql( """ query ProjectRunQueues($entity: String!, $projectName: String!){ project(entityName: $entity, name: $projectName) { runQueues { id ...
python
wandb/sdk/internal/internal_api.py
1,102
1,139
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,307
create_run_queue
def create_run_queue( self, entity: str, project: str, queue_name: str, access: str ) -> Optional[Dict[str, Any]]: query = gql( """ mutation createRunQueue($entity: String!, $project: String!, $queueName: String!, $access: RunQueueAccessType!){ createRunQueue( ...
python
wandb/sdk/internal/internal_api.py
1,142
1,171
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,308
push_to_run_queue_by_name
def push_to_run_queue_by_name( self, entity: str, project: str, queue_name: str, run_spec: str ) -> Optional[Dict[str, Any]]: """Queryless mutation, should be used before legacy fallback method.""" mutation = gql( """ mutation pushToRunQueueByName( $entityName...
python
wandb/sdk/internal/internal_api.py
1,174
1,255
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,309
push_to_run_queue
def push_to_run_queue( self, queue_name: str, launch_spec: Dict[str, str], project_queue: str, ) -> Optional[Dict[str, Any]]: entity = launch_spec["entity"] run_spec = json.dumps(launch_spec) push_result = self.push_to_run_queue_by_name( entity, p...
python
wandb/sdk/internal/internal_api.py
1,258
1,339
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,310
pop_from_run_queue
def pop_from_run_queue( self, queue_name: str, entity: Optional[str] = None, project: Optional[str] = None, agent_id: Optional[str] = None, ) -> Optional[Dict[str, Any]]: mutation = gql( """ mutation popFromRunQueue($entity: String!, $project: Stri...
python
wandb/sdk/internal/internal_api.py
1,342
1,374
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,311
ack_run_queue_item
def ack_run_queue_item(self, item_id: str, run_id: Optional[str] = None) -> bool: mutation = gql( """ mutation ackRunQueueItem($itemId: ID!, $runId: String!) { ackRunQueueItem(input: { runQueueItemId: $itemId, runName: $runId }) { success } } ...
python
wandb/sdk/internal/internal_api.py
1,377
1,395
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,312
create_launch_agent
def create_launch_agent( self, entity: str, project: str, queues: List[str], gorilla_agent_support: bool, ) -> dict: project_queues = self.get_project_run_queues(entity, project) if not project_queues: # create default queue if it doesn't already e...
python
wandb/sdk/internal/internal_api.py
1,398
1,458
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,313
update_launch_agent_status
def update_launch_agent_status( self, agent_id: str, status: str, gorilla_agent_support: bool, ) -> dict: if not gorilla_agent_support: # if gorilla doesn't support launch agents, this is a no-op return { "success": True, } ...
python
wandb/sdk/internal/internal_api.py
1,461
1,492
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,314
get_launch_agent
def get_launch_agent(self, agent_id: str, gorilla_agent_support: bool) -> dict: if not gorilla_agent_support: return { "id": None, "name": "", "stopPolling": False, } query = gql( """ query LaunchAgent($agent...
python
wandb/sdk/internal/internal_api.py
1,495
1,521
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,315
upsert_run
def upsert_run( self, id: Optional[str] = None, name: Optional[str] = None, project: Optional[str] = None, host: Optional[str] = None, group: Optional[str] = None, tags: Optional[List[str]] = None, config: Optional[dict] = None, description: Option...
python
wandb/sdk/internal/internal_api.py
1,524
1,718
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,316
get_run_info
def get_run_info( self, entity: str, project: str, name: str, ) -> dict: query = gql( """ query RunInfo($project: String!, $entity: String!, $name: String!) { project(name: $project, entityName: $entity) { run(name: $name) { ...
python
wandb/sdk/internal/internal_api.py
1,721
1,768
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,317
get_run_state
def get_run_state(self, entity: str, project: str, name: str) -> str: query = gql( """ query RunState( $project: String!, $entity: String!, $name: String!) { project(name: $project, entityName: $entity) { run(name: $name) { ...
python
wandb/sdk/internal/internal_api.py
1,771
1,795
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,318
upload_urls
def upload_urls( self, project: str, files: Union[List[str], Dict[str, IO]], run: Optional[str] = None, entity: Optional[str] = None, description: Optional[str] = None, ) -> Tuple[str, List[str], Dict[str, Dict[str, Any]]]: """Generate temporary resumable uplo...
python
wandb/sdk/internal/internal_api.py
1,798
1,866
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,319
download_urls
def download_urls( self, project: str, run: Optional[str] = None, entity: Optional[str] = None, ) -> Dict[str, Dict[str, str]]: """Generate download urls. Arguments: project (str): The project to download run (str): The run to upload to ...
python
wandb/sdk/internal/internal_api.py
1,869
1,924
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,320
download_url
def download_url( self, project: str, file_name: str, run: Optional[str] = None, entity: Optional[str] = None, ) -> Optional[Dict[str, str]]: """Generate download urls. Arguments: project (str): The project to download file_name (str):...
python
wandb/sdk/internal/internal_api.py
1,927
1,983
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,321
download_file
def download_file(self, url: str) -> Tuple[int, requests.Response]: """Initiate a streaming download. Arguments: url (str): The url to download Returns: A tuple of the content length and the streaming response """ response = requests.get(url, auth=("user...
python
wandb/sdk/internal/internal_api.py
1,986
1,997
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,322
download_write_file
def download_write_file( self, metadata: Dict[str, str], out_dir: Optional[str] = None, ) -> Tuple[str, Optional[requests.Response]]: """Download a file from a run and write it to wandb/. Arguments: metadata (obj): The metadata object for the file to download. Co...
python
wandb/sdk/internal/internal_api.py
2,000
2,026
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,323
upload_file_azure
def upload_file_azure( self, url: str, file: Any, extra_headers: Dict[str, str] ) -> None: """Upload a file to azure.""" from azure.core.exceptions import AzureError # type: ignore # Configure the client without retries so our existing logic can handle them client = self._a...
python
wandb/sdk/internal/internal_api.py
2,028
2,061
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,324
upload_file
def upload_file( self, url: str, file: IO[bytes], callback: Optional["ProgressFn"] = None, extra_headers: Optional[Dict[str, str]] = None, ) -> Optional[requests.Response]: """Upload a file to W&B with failure resumption. Arguments: url: The url t...
python
wandb/sdk/internal/internal_api.py
2,063
2,127
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,325
upload_file_async
async def upload_file_async( self, url: str, file: IO[bytes], callback: Optional["ProgressFn"] = None, extra_headers: Optional[Dict[str, str]] = None, ) -> None: """An async not-quite-equivalent version of `upload_file`. Differences from `upload_file`: ...
python
wandb/sdk/internal/internal_api.py
2,129
2,198
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,326
upload_file_retry_async
async def upload_file_retry_async( self, url: str, file: IO[bytes], callback: Optional["ProgressFn"] = None, extra_headers: Optional[Dict[str, str]] = None, num_retries: int = 100, ) -> None: backoff = retry.FilteredBackoff( filter=check_httpx_exc_...
python
wandb/sdk/internal/internal_api.py
2,200
2,225
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,327
register_agent
def register_agent( self, host: str, sweep_id: Optional[str] = None, project_name: Optional[str] = None, entity: Optional[str] = None, ) -> dict: """Register a new agent. Arguments: host (str): hostname sweep_id (str): sweep id ...
python
wandb/sdk/internal/internal_api.py
2,228
2,280
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,328
agent_heartbeat
def agent_heartbeat( self, agent_id: str, metrics: dict, run_states: dict ) -> List[str]: """Notify server about agent state, receive commands. Arguments: agent_id (str): agent_id metrics (dict): system metrics run_states (dict): run_id: state mapping ...
python
wandb/sdk/internal/internal_api.py
2,282
2,335
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,329
_validate_config_and_fill_distribution
def _validate_config_and_fill_distribution(config: dict) -> dict: # verify that parameters are well specified. # TODO(dag): deprecate this in favor of jsonschema validation once # apiVersion 2 is released and local controller is integrated with # wandb/client. # avoid modifying ...
python
wandb/sdk/internal/internal_api.py
2,338
2,374
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,330
upsert_sweep
def upsert_sweep( self, config: dict, controller: Optional[str] = None, launch_scheduler: Optional[str] = None, scheduler: Optional[str] = None, obj_id: Optional[str] = None, project: Optional[str] = None, entity: Optional[str] = None, state: Optio...
python
wandb/sdk/internal/internal_api.py
2,377
2,510
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,331
create_anonymous_api_key
def create_anonymous_api_key(self) -> str: """Create a new API key belonging to a new anonymous user.""" mutation = gql( """ mutation CreateAnonymousApiKey { createAnonymousEntity(input: {}) { apiKey { name } ...
python
wandb/sdk/internal/internal_api.py
2,513
2,529
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,332
file_current
def file_current(fname: str, md5: B64MD5) -> bool: """Checksum a file and compare the md5 with the known md5.""" return os.path.isfile(fname) and md5_file_b64(fname) == md5
python
wandb/sdk/internal/internal_api.py
2,532
2,534
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,333
pull
def pull( self, project: str, run: Optional[str] = None, entity: Optional[str] = None ) -> "List[requests.Response]": """Download files from W&B. Arguments: project (str): The project to download run (str, optional): The run to upload to entity (str, opti...
python
wandb/sdk/internal/internal_api.py
2,537
2,558
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,334
get_project
def get_project(self) -> str: project: str = self.settings("project") return project
python
wandb/sdk/internal/internal_api.py
2,560
2,562
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,335
push
def push( self, files: Union[List[str], Dict[str, IO]], run: Optional[str] = None, entity: Optional[str] = None, project: Optional[str] = None, description: Optional[str] = None, force: bool = True, progress: Union[TextIO, bool] = False, ) -> "List[Opt...
python
wandb/sdk/internal/internal_api.py
2,565
2,658
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,336
link_artifact
def link_artifact( self, client_id: str, server_id: str, portfolio_name: str, entity: str, project: str, aliases: Sequence[str], ) -> Dict[str, Any]: template = """ mutation LinkArtifact( $artifactPortfolioName: Stri...
python
wandb/sdk/internal/internal_api.py
2,660
2,715
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,337
replace
def replace(a: str, b: str) -> None: nonlocal template template = template.replace(a, b)
python
wandb/sdk/internal/internal_api.py
2,689
2,691
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,338
use_artifact
def use_artifact( self, artifact_id: str, entity_name: Optional[str] = None, project_name: Optional[str] = None, run_name: Optional[str] = None, use_as: Optional[str] = None, ) -> Optional[Dict[str, Any]]: query_template = """ mutation UseArtifact( ...
python
wandb/sdk/internal/internal_api.py
2,717
2,783
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,339
create_artifact_type
def create_artifact_type( self, artifact_type_name: str, entity_name: Optional[str] = None, project_name: Optional[str] = None, description: Optional[str] = None, ) -> Optional[str]: mutation = gql( """ mutation CreateArtifactType( $ent...
python
wandb/sdk/internal/internal_api.py
2,785
2,825
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,340
create_artifact
def create_artifact( self, artifact_type_name: str, artifact_collection_name: str, digest: str, client_id: Optional[str] = None, sequence_client_id: Optional[str] = None, entity_name: Optional[str] = None, project_name: Optional[str] = None, run_na...
python
wandb/sdk/internal/internal_api.py
2,827
2,984
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,341
commit_artifact
def commit_artifact(self, artifact_id: str) -> "_Response": mutation = gql( """ mutation CommitArtifact( $artifactID: ID!, ) { commitArtifact(input: { artifactID: $artifactID, }) { artifact { id ...
python
wandb/sdk/internal/internal_api.py
2,986
3,009
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,342
create_artifact_manifest
def create_artifact_manifest( self, name: str, digest: str, artifact_id: Optional[str], base_artifact_id: Optional[str] = None, entity: Optional[str] = None, project: Optional[str] = None, run: Optional[str] = None, include_upload: bool = True, ...
python
wandb/sdk/internal/internal_api.py
3,011
3,089
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,343
update_artifact_manifest
def update_artifact_manifest( self, artifact_manifest_id: str, base_artifact_id: Optional[str] = None, digest: Optional[str] = None, include_upload: Optional[bool] = True, ) -> Tuple[str, Dict[str, Any]]: mutation = gql( """ mutation UpdateArtifact...
python
wandb/sdk/internal/internal_api.py
3,091
3,139
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,344
_resolve_client_id
def _resolve_client_id( self, client_id: str, ) -> Optional[str]: if client_id in self._client_id_mapping: return self._client_id_mapping[client_id] query = gql( """ query ClientIDMapping($clientID: ID!) { clientIDMapping(clientID:...
python
wandb/sdk/internal/internal_api.py
3,141
3,170
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,345
create_artifact_files
def create_artifact_files( self, artifact_files: Iterable["CreateArtifactFileSpecInput"] ) -> Mapping[str, "CreateArtifactFilesResponseFile"]: mutation = gql( """ mutation CreateArtifactFiles( $storageLayout: ArtifactStorageLayout! $artifactFiles: [CreateA...
python
wandb/sdk/internal/internal_api.py
3,173
3,224
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,346
notify_scriptable_run_alert
def notify_scriptable_run_alert( self, title: str, text: str, level: Optional[str] = None, wait_duration: Optional["Number"] = None, ) -> bool: mutation = gql( """ mutation NotifyScriptableRunAlert( $entityName: String!, $pr...
python
wandb/sdk/internal/internal_api.py
3,227
3,273
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,347
get_sweep_state
def get_sweep_state( self, sweep: str, entity: Optional[str] = None, project: Optional[str] = None ) -> "SweepState": state: "SweepState" = self.sweep( sweep=sweep, entity=entity, project=project, specs="{}" )["state"] return state
python
wandb/sdk/internal/internal_api.py
3,275
3,281
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,348
set_sweep_state
def set_sweep_state( self, sweep: str, state: "SweepState", entity: Optional[str] = None, project: Optional[str] = None, ) -> None: assert state in ("RUNNING", "PAUSED", "CANCELED", "FINISHED") s = self.sweep(sweep=sweep, entity=entity, project=project, specs=...
python
wandb/sdk/internal/internal_api.py
3,283
3,329
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,349
stop_sweep
def stop_sweep( self, sweep: str, entity: Optional[str] = None, project: Optional[str] = None, ) -> None: """Finish the sweep to stop running new runs and let currently running runs finish.""" self.set_sweep_state( sweep=sweep, state="FINISHED", entity=ent...
python
wandb/sdk/internal/internal_api.py
3,331
3,340
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,350
cancel_sweep
def cancel_sweep( self, sweep: str, entity: Optional[str] = None, project: Optional[str] = None, ) -> None: """Cancel the sweep to kill all running runs and stop running new runs.""" self.set_sweep_state( sweep=sweep, state="CANCELED", entity=entity, proje...
python
wandb/sdk/internal/internal_api.py
3,342
3,351
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,351
pause_sweep
def pause_sweep( self, sweep: str, entity: Optional[str] = None, project: Optional[str] = None, ) -> None: """Pause the sweep to temporarily stop running new runs.""" self.set_sweep_state( sweep=sweep, state="PAUSED", entity=entity, project=project ...
python
wandb/sdk/internal/internal_api.py
3,353
3,362
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,352
resume_sweep
def resume_sweep( self, sweep: str, entity: Optional[str] = None, project: Optional[str] = None, ) -> None: """Resume the sweep to continue running new runs.""" self.set_sweep_state( sweep=sweep, state="RUNNING", entity=entity, project=project )
python
wandb/sdk/internal/internal_api.py
3,364
3,373
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,353
_status_request
def _status_request(self, url: str, length: int) -> requests.Response: """Ask google how much we've uploaded.""" return requests.put( url=url, headers={"Content-Length": "0", "Content-Range": "bytes */%i" % length}, )
python
wandb/sdk/internal/internal_api.py
3,375
3,380
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,354
_flatten_edges
def _flatten_edges(self, response: "_Response") -> List[Dict]: """Return an array from the nested graphql relay structure.""" return [node["node"] for node in response["edges"]]
python
wandb/sdk/internal/internal_api.py
3,382
3,384
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,355
_dict_nested_set
def _dict_nested_set(target: Dict[str, Any], key_list: Sequence[str], v: Any) -> None: # recurse down the dictionary structure: for k in key_list[:-1]: target.setdefault(k, {}) new_target = target.get(k) if TYPE_CHECKING: new_target = cast(Dict[str, Any], new_target) ...
python
wandb/sdk/internal/handler.py
51
61
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,356
__init__
def __init__( self, settings: SettingsStatic, record_q: "Queue[Record]", result_q: "Queue[Result]", stopped: Event, writer_q: "Queue[Record]", interface: InterfaceQueue, context_keeper: context.ContextKeeper, ) -> None: self._settings = setting...
python
wandb/sdk/internal/handler.py
87
124
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,357
__len__
def __len__(self) -> int: return self._record_q.qsize()
python
wandb/sdk/internal/handler.py
126
127
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,358
handle
def handle(self, record: Record) -> None: self._context_keeper.add_from_record(record) record_type = record.WhichOneof("record_type") assert record_type handler_str = "handle_" + record_type handler: Callable[[Record], None] = getattr(self, handler_str, None) # type: ignore ...
python
wandb/sdk/internal/handler.py
129
136
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,359
handle_request
def handle_request(self, record: Record) -> None: request_type = record.request.WhichOneof("request_type") assert request_type handler_str = "handle_request_" + request_type handler: Callable[[Record], None] = getattr(self, handler_str, None) # type: ignore if request_type != "n...
python
wandb/sdk/internal/handler.py
138
146
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,360
_dispatch_record
def _dispatch_record(self, record: Record, always_send: bool = False) -> None: if always_send: record.control.always_send = True tracelog.log_message_queue(record, self._writer_q) self._writer_q.put(record)
python
wandb/sdk/internal/handler.py
148
152
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,361
_respond_result
def _respond_result(self, result: Result) -> None: tracelog.log_message_queue(result, self._result_q) context_id = context.context_id_from_result(result) self._context_keeper.release(context_id) self._result_q.put(result)
python
wandb/sdk/internal/handler.py
154
158
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,362
debounce
def debounce(self) -> None: pass
python
wandb/sdk/internal/handler.py
160
161
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,363
handle_request_cancel
def handle_request_cancel(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
163
164
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,364
handle_request_defer
def handle_request_defer(self, record: Record) -> None: defer = record.request.defer state = defer.state logger.info(f"handle defer: {state}") # only handle flush tb (sender handles the rest) if state == defer.FLUSH_STATS: # TODO(jhr): this could block so we dont rea...
python
wandb/sdk/internal/handler.py
166
188
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,365
handle_request_login
def handle_request_login(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
190
191
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,366
handle_run
def handle_run(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
193
194
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,367
handle_stats
def handle_stats(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
196
197
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,368
handle_config
def handle_config(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
199
200
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,369
handle_output
def handle_output(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
202
203
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,370
handle_output_raw
def handle_output_raw(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
205
206
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,371
handle_files
def handle_files(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
208
209
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,372
handle_link_artifact
def handle_link_artifact(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
211
212
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,373
handle_use_artifact
def handle_use_artifact(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
214
215
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,374
handle_artifact
def handle_artifact(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
217
218
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,375
handle_alert
def handle_alert(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
220
221
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,376
_save_summary
def _save_summary(self, summary_dict: SummaryDict, flush: bool = False) -> None: summary = SummaryRecord() for k, v in summary_dict.items(): update = summary.update.add() update.key = k update.value_json = json.dumps(v) if flush: record = Record(su...
python
wandb/sdk/internal/handler.py
223
238
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,377
_save_history
def _save_history( self, history: HistoryRecord, ) -> None: for item in history.item: # TODO(jhr) save nested keys? k = item.key v = json.loads(item.value_json) if isinstance(v, numbers.Real): self._sampled_history[k].add(v)
python
wandb/sdk/internal/handler.py
240
249
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,378
_update_summary_metrics
def _update_summary_metrics( self, s: "MetricSummary", kl: List[str], v: "numbers.Real", float_v: float, goal_max: Optional[bool], ) -> bool: updated = False best_key: Optional[Tuple[str, ...]] = None if s.none: return False ...
python
wandb/sdk/internal/handler.py
251
312
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,379
_update_summary_leaf
def _update_summary_leaf( self, kl: List[str], v: Any, d: Optional[MetricRecord] = None, ) -> bool: has_summary = d and d.HasField("summary") if len(kl) == 1: copy_key = tuple(kl) old_copy = self._metric_copy.get(copy_key) if old_co...
python
wandb/sdk/internal/handler.py
314
346
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,380
_update_summary_list
def _update_summary_list( self, kl: List[str], v: Any, d: Optional[MetricRecord] = None, ) -> bool: metric_key = ".".join([k.replace(".", "\\.") for k in kl]) d = self._metric_defines.get(metric_key, d) # if the dict has _type key, it's a wandb table object ...
python
wandb/sdk/internal/handler.py
348
369
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,381
_update_summary_media_objects
def _update_summary_media_objects(self, v: Dict[str, Any]) -> Dict[str, Any]: # For now, non-recursive - just top level for nk, nv in v.items(): if ( isinstance(nv, dict) and handler_util.metric_is_wandb_dict(nv) and "_latest_artifact_path" in ...
python
wandb/sdk/internal/handler.py
371
383
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,382
_update_summary
def _update_summary(self, history_dict: Dict[str, Any]) -> List[str]: # keep old behavior fast path if no define metrics have been used if not self._metric_defines: history_dict = self._update_summary_media_objects(history_dict) self._consolidated_summary.update(history_dict) ...
python
wandb/sdk/internal/handler.py
385
395
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,383
_history_assign_step
def _history_assign_step( self, history: HistoryRecord, history_dict: Dict[str, Any], ) -> None: has_step = history.HasField("step") item = history.item.add() item.key = "_step" if has_step: step = history.step.num history_dict["_step"]...
python
wandb/sdk/internal/handler.py
397
413
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,384
_history_define_metric
def _history_define_metric(self, hkey: str) -> Optional[MetricRecord]: """Check for hkey match in glob metrics and return the defined metric.""" # Dont define metric for internal metrics if hkey.startswith("_"): return None for k, mglob in self._metric_globs.items(): ...
python
wandb/sdk/internal/handler.py
415
429
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,385
_history_update_leaf
def _history_update_leaf( self, kl: List[str], v: Any, history_dict: Dict[str, Any], update_history: Dict[str, Any], ) -> None: hkey = ".".join([k.replace(".", "\\.") for k in kl]) m = self._metric_defines.get(hkey) if not m: m = self._hist...
python
wandb/sdk/internal/handler.py
431
454
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,386
_history_update_list
def _history_update_list( self, kl: List[str], v: Any, history_dict: Dict[str, Any], update_history: Dict[str, Any], ) -> None: if isinstance(v, dict): for nk, nv in v.items(): self._history_update_list( kl=kl[:] + [nk],...
python
wandb/sdk/internal/handler.py
456
474
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,387
_history_update
def _history_update( self, history: HistoryRecord, history_dict: Dict[str, Any], ) -> None: # if syncing an old run, we can skip this logic if history_dict.get("_step") is None: self._history_assign_step(history, history_dict) update_history: Dict[str, A...
python
wandb/sdk/internal/handler.py
476
496
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,388
handle_history
def handle_history(self, record: Record) -> None: history_dict = proto_util.dict_from_proto_list(record.history.item) # Inject _runtime if it is not present if history_dict is not None: if "_runtime" not in history_dict: self._history_assign_runtime(record.history, h...
python
wandb/sdk/internal/handler.py
498
512
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,389
_flush_partial_history
def _flush_partial_history( self, step: Optional[int] = None, ) -> None: if not self._partial_history: return history = HistoryRecord() for k, v in self._partial_history.items(): item = history.item.add() item.key = k item.valu...
python
wandb/sdk/internal/handler.py
514
529
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,390
handle_request_sender_mark_report
def handle_request_sender_mark_report(self, record: Record) -> None: self._dispatch_record(record, always_send=True)
python
wandb/sdk/internal/handler.py
531
532
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,391
handle_request_status_report
def handle_request_status_report(self, record: Record) -> None: self._dispatch_record(record, always_send=True)
python
wandb/sdk/internal/handler.py
534
535
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,392
handle_request_partial_history
def handle_request_partial_history(self, record: Record) -> None: partial_history = record.request.partial_history flush = None if partial_history.HasField("action"): flush = partial_history.action.flush step = None if partial_history.HasField("step"): s...
python
wandb/sdk/internal/handler.py
537
564
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,393
handle_summary
def handle_summary(self, record: Record) -> None: summary = record.summary for item in summary.update: if len(item.nested_key) > 0: # we use either key or nested_key -- not both assert item.key == "" key = tuple(item.nested_key) els...
python
wandb/sdk/internal/handler.py
566
606
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,394
handle_exit
def handle_exit(self, record: Record) -> None: if self._track_time is not None: self._accumulate_time += time.time() - self._track_time record.exit.runtime = int(self._accumulate_time) self._dispatch_record(record, always_send=True)
python
wandb/sdk/internal/handler.py
608
612
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,395
handle_final
def handle_final(self, record: Record) -> None: self._dispatch_record(record, always_send=True)
python
wandb/sdk/internal/handler.py
614
615
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,396
handle_preempting
def handle_preempting(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
617
618
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,397
handle_header
def handle_header(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
620
621
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,398
handle_footer
def handle_footer(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
623
624
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,399
handle_request_check_version
def handle_request_check_version(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
626
627
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }
4,400
handle_request_attach
def handle_request_attach(self, record: Record) -> None: self._dispatch_record(record)
python
wandb/sdk/internal/handler.py
629
630
{ "name": "Git-abouvier/wandb", "url": "https://github.com/Git-abouvier/wandb.git", "license": "MIT", "stars": 0, "forks": 0 }