id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
2,501 | __repr__ | def __repr__(self):
# use a copy of _dict, except add placeholders for h5 objects, etc.
# that haven't been loaded yet
repr_dict = dict(self._dict)
for k in self._json_dict:
v = self._json_dict[k]
if (
k not in repr_dict
and isinsta... | python | wandb/old/summary.py | 146 | 163 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,502 | update | def update(self, key_vals=None, overwrite=True):
"""Locked keys will be overwritten unless overwrite=False.
Otherwise, written keys will be added to the "locked" list.
"""
if key_vals:
write_items = self._update(key_vals, overwrite)
self._root._root_set(self._pat... | python | wandb/old/summary.py | 165 | 173 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,503 | _update | def _update(self, key_vals, overwrite):
if not key_vals:
return
key_vals = {k.strip(): v for k, v in key_vals.items()}
if overwrite:
write_items = list(key_vals.items())
self._locked_keys.update(key_vals.keys())
else:
write_keys = set(key... | python | wandb/old/summary.py | 175 | 195 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,504 | __init__ | def __init__(self, run, summary=None):
super().__init__()
self._run = run
self._h5_path = os.path.join(self._run.dir, DEEP_SUMMARY_FNAME)
# Lazy load the h5 file
self._h5 = None
# Mirrored version of self._dict with versions of values that get written
# to JSON k... | python | wandb/old/summary.py | 206 | 218 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,505 | _json_get | def _json_get(self, path):
pass | python | wandb/old/summary.py | 220 | 221 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,506 | _root_get | def _root_get(self, path, child_dict):
json_dict = self._json_dict
for key in path[:-1]:
json_dict = json_dict[key]
key = path[-1]
if key in json_dict:
child_dict[key] = self._decode(path, json_dict[key]) | python | wandb/old/summary.py | 223 | 230 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,507 | _root_del | def _root_del(self, path):
json_dict = self._json_dict
for key in path[:-1]:
json_dict = json_dict[key]
val = json_dict[path[-1]]
del json_dict[path[-1]]
if isinstance(val, dict) and val.get("_type") in H5_TYPES:
if not h5py:
wandb.termerr... | python | wandb/old/summary.py | 232 | 246 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,508 | _root_set | def _root_set(self, path, new_keys_values):
json_dict = self._json_dict
for key in path:
json_dict = json_dict[key]
for new_key, new_value in new_keys_values:
json_dict[new_key] = self._encode(new_value, path + (new_key,)) | python | wandb/old/summary.py | 248 | 254 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,509 | write_h5 | def write_h5(self, path, val):
# ensure the file is open
self.open_h5()
if not self._h5:
wandb.termerror("Storing tensors in summary requires h5py")
else:
try:
del self._h5["summary/" + ".".join(path)]
except KeyError:
... | python | wandb/old/summary.py | 256 | 268 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,510 | read_h5 | def read_h5(self, path, val=None):
# ensure the file is open
self.open_h5()
if not self._h5:
wandb.termerror("Reading tensors from summary requires h5py")
else:
return self._h5.get("summary/" + ".".join(path), val) | python | wandb/old/summary.py | 270 | 277 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,511 | open_h5 | def open_h5(self):
if not self._h5 and h5py:
self._h5 = h5py.File(self._h5_path, "a", libver="latest") | python | wandb/old/summary.py | 279 | 281 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,512 | _decode | def _decode(self, path, json_value):
"""Decode a `dict` encoded by `Summary._encode()`, loading h5 objects.
h5 objects may be very large, so we won't have loaded them automatically.
"""
if isinstance(json_value, dict):
if json_value.get("_type") in H5_TYPES:
... | python | wandb/old/summary.py | 283 | 300 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,513 | _encode | def _encode(self, value, path_from_root):
"""Normalize, compress, and encode sub-objects for backend storage.
value: Object to encode.
path_from_root: `tuple` of key strings from the top-level summary to the
current `value`.
Returns:
A new tree of dict's with la... | python | wandb/old/summary.py | 302 | 333 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,514 | download_h5 | def download_h5(run_id, entity=None, project=None, out_dir=None):
api = Api()
meta = api.download_url(
project or api.settings("project"),
DEEP_SUMMARY_FNAME,
entity=entity or api.settings("entity"),
run=run_id,
)
if meta and "md5" in meta and meta["md5"] is not None:
... | python | wandb/old/summary.py | 336 | 348 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,515 | upload_h5 | def upload_h5(file, run_id, entity=None, project=None):
api = Api()
wandb.termlog("Uploading summary data...")
with open(file, "rb") as f:
api.push(
{os.path.basename(file): f}, run=run_id, project=project, entity=entity
) | python | wandb/old/summary.py | 351 | 357 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,516 | __init__ | def __init__(self, run):
super().__init__(run)
self._fname = os.path.join(run.dir, wandb_lib.filenames.SUMMARY_FNAME)
self.load() | python | wandb/old/summary.py | 361 | 364 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,517 | load | def load(self):
try:
with open(self._fname) as f:
self._json_dict = json.load(f)
except (OSError, ValueError):
self._json_dict = {} | python | wandb/old/summary.py | 366 | 371 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,518 | _write | def _write(self, commit=False):
# TODO: we just ignore commit to ensure backward capability
with open(self._fname, "w") as f:
f.write(util.json_dumps_safer(self._json_dict))
f.write("\n")
f.flush()
os.fsync(f.fileno())
if self._h5:
self... | python | wandb/old/summary.py | 373 | 384 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,519 | __init__ | def __init__(self, run, client, summary=None):
super().__init__(run, summary=summary)
self._run = run
self._client = client
self._started = time.time() | python | wandb/old/summary.py | 388 | 392 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,520 | load | def load(self):
pass | python | wandb/old/summary.py | 394 | 395 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,521 | open_h5 | def open_h5(self):
if not self._h5 and h5py:
download_h5(
self._run.id,
entity=self._run.entity,
project=self._run.project,
out_dir=self._run.dir,
)
super().open_h5() | python | wandb/old/summary.py | 397 | 405 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,522 | _write | def _write(self, commit=False):
mutation = gql(
"""
mutation UpsertBucket( $id: String, $summaryMetrics: JSONString) {
upsertBucket(input: { id: $id, summaryMetrics: $summaryMetrics}) {
bucket { id }
}
}
"""
)
if commit:... | python | wandb/old/summary.py | 407 | 436 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,523 | __init__ | def __init__(
self, load_settings: bool = True, root_dir: Optional[str] = None
) -> None:
self._global_settings = Settings._settings()
self._local_settings = Settings._settings()
self.root_dir = root_dir
if load_settings:
self._global_settings.read([Settings._glo... | python | wandb/old/settings.py | 17 | 28 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,524 | get | def get(self, section: str, key: str, fallback: Any = _UNSET) -> Any:
# Try the local settings first. If we can't find the key, then try the global settings.
# If a fallback is provided, return it if we can't find the key in either the local or global
# settings.
try:
return ... | python | wandb/old/settings.py | 30 | 43 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,525 | set | def set(self, section, key, value, globally=False, persist=False) -> None:
"""Persist settings to disk if persist = True"""
def write_setting(settings, settings_path, persist):
if not settings.has_section(section):
Settings._safe_add_section(settings, Settings.DEFAULT_SECTIO... | python | wandb/old/settings.py | 45 | 61 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,526 | write_setting | def write_setting(settings, settings_path, persist):
if not settings.has_section(section):
Settings._safe_add_section(settings, Settings.DEFAULT_SECTION)
settings.set(section, key, str(value))
if persist:
with open(settings_path, "w+") as f:
... | python | wandb/old/settings.py | 48 | 54 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,527 | clear | def clear(self, section, key, globally=False, persist=False) -> None:
def clear_setting(settings, settings_path, persist):
settings.remove_option(section, key)
if persist:
with open(settings_path, "w+") as f:
settings.write(f)
if globally:
... | python | wandb/old/settings.py | 63 | 75 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,528 | clear_setting | def clear_setting(settings, settings_path, persist):
settings.remove_option(section, key)
if persist:
with open(settings_path, "w+") as f:
settings.write(f) | python | wandb/old/settings.py | 64 | 68 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,529 | items | def items(self, section=None):
section = section if section is not None else Settings.DEFAULT_SECTION
result = {"section": section}
try:
if section in self._global_settings.sections():
for option in self._global_settings.options(section):
result[... | python | wandb/old/settings.py | 77 | 92 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,530 | _safe_add_section | def _safe_add_section(settings, section):
if not settings.has_section(section):
settings.add_section(section) | python | wandb/old/settings.py | 95 | 97 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,531 | _settings | def _settings(default_settings={}):
settings = configparser.ConfigParser()
Settings._safe_add_section(settings, Settings.DEFAULT_SECTION)
for key, value in default_settings.items():
settings.set(Settings.DEFAULT_SECTION, key, str(value))
return settings | python | wandb/old/settings.py | 100 | 105 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,532 | _global_path | def _global_path():
config_dir = os.environ.get(
env.CONFIG_DIR, os.path.join(os.path.expanduser("~"), ".config", "wandb")
)
os.makedirs(config_dir, exist_ok=True)
return os.path.join(config_dir, "settings") | python | wandb/old/settings.py | 108 | 113 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,533 | _local_path | def _local_path(root_dir=None):
filesystem.mkdir_exists_ok(core.wandb_dir(root_dir))
return os.path.join(core.wandb_dir(root_dir), "settings") | python | wandb/old/settings.py | 116 | 118 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,534 | cli_unsupported | def cli_unsupported(argument):
wandb.termerror(f"Unsupported argument `{argument}`")
sys.exit(1) | python | wandb/cli/cli.py | 79 | 81 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,535 | format_message | def format_message(self):
# log_file = util.get_log_file_path()
log_file = ""
orig_type = f"{self.orig_type.__module__}.{self.orig_type.__name__}"
if issubclass(self.orig_type, Error):
return click.style(str(self.message), fg="red")
else:
return (
... | python | wandb/cli/cli.py | 85 | 95 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,536 | display_error | def display_error(func):
"""Function decorator for catching common errors and re-raising as wandb.Error."""
@wraps(func)
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except wandb.Error as e:
exc_type, exc_value, exc_traceback = sys.exc_info()
... | python | wandb/cli/cli.py | 98 | 114 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,537 | wrapper | def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except wandb.Error as e:
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
logger.error("".join(lines))
wan... | python | wandb/cli/cli.py | 102 | 112 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,538 | _get_cling_api | def _get_cling_api(reset=None):
"""Get a reference to the internal api with cling settings."""
global _api
if reset:
_api = None
wandb_sdk.wandb_setup._setup(_reset=True)
if _api is None:
# TODO(jhr): make a settings object that is better for non runs.
# only override the... | python | wandb/cli/cli.py | 120 | 131 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,539 | prompt_for_project | def prompt_for_project(ctx, entity):
"""Ask the user for a project, creating one if necessary."""
result = ctx.invoke(projects, entity=entity, display=False)
api = _get_cling_api()
try:
if len(result) == 0:
project = click.prompt("Enter a name for your first project")
# d... | python | wandb/cli/cli.py | 134 | 162 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,540 | get_command | def get_command(self, ctx, cmd_name):
# TODO: check if cmd_name is a file in the current dir and not require `run`?
rv = click.Group.get_command(self, ctx, cmd_name)
if rv is not None:
return rv
return None | python | wandb/cli/cli.py | 167 | 172 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,541 | cli | def cli(ctx):
# wandb.try_to_set_up_global_logging()
if ctx.invoked_subcommand is None:
click.echo(ctx.get_help()) | python | wandb/cli/cli.py | 178 | 181 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,542 | projects | def projects(entity, display=True):
api = _get_cling_api()
projects = api.list_projects(entity=entity)
if len(projects) == 0:
message = "No projects found for %s" % entity
else:
message = 'Latest projects for "%s"' % entity
if display:
click.echo(click.style(message, bold=Tru... | python | wandb/cli/cli.py | 193 | 212 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,543 | login | def login(key, host, cloud, relogin, anonymously, no_offline=False):
# TODO: handle no_offline
anon_mode = "must" if anonymously else "never"
wandb_sdk.wandb_login._handle_host_wandb_setting(host, cloud)
# A change in click or the test harness means key can be none...
key = key[0] if key is not Non... | python | wandb/cli/cli.py | 224 | 248 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,544 | service | def service(
grpc_port=None,
sock_port=None,
port_filename=None,
address=None,
pid=None,
debug=False,
serve_sock=False,
serve_grpc=False,
):
from wandb.sdk.service.server import WandbServer
server = WandbServer(
grpc_port=grpc_port,
sock_port=sock_port,
p... | python | wandb/cli/cli.py | 267 | 289 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,545 | init | def init(ctx, project, entity, reset, mode):
from wandb.old.core import __stage_dir__, _set_stage_dir, wandb_dir
if __stage_dir__ is None:
_set_stage_dir("wandb")
# non-interactive init
if reset or project or entity or mode:
api = InternalApi()
if reset:
api.clear_s... | python | wandb/cli/cli.py | 308 | 426 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,546 | sync | def sync(
ctx,
path=None,
view=None,
verbose=None,
run_id=None,
project=None,
entity=None,
sync_tensorboard=None,
include_globs=None,
exclude_globs=None,
include_online=None,
include_offline=None,
include_synced=None,
mark_synced=None,
sync_all=None,
ignor... | python | wandb/cli/cli.py | 489 | 662 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,547 | _summary | def _summary():
all_items = get_runs(
include_online=True,
include_offline=True,
include_synced=True,
include_unsynced=True,
)
sync_items = get_runs(
include_online=include_online if include_online is not None else True,
inc... | python | wandb/cli/cli.py | 527 | 563 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,548 | _sync_path | def _sync_path(_path, _sync_tensorboard):
if run_id and len(_path) > 1:
wandb.termerror("id can only be set for a single run.")
sys.exit(1)
sm = SyncManager(
project=project,
entity=entity,
run_id=run_id,
mark_synced=mark_synced,
... | python | wandb/cli/cli.py | 565 | 585 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,549 | _sync_all | def _sync_all():
sync_items = get_runs(
include_online=include_online if include_online is not None else True,
include_offline=include_offline if include_offline is not None else True,
include_synced=include_synced if include_synced is not None else False,
include... | python | wandb/cli/cli.py | 587 | 601 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,550 | _clean | def _clean():
if path:
runs = list(map(get_run_from_path, path))
if not clean_force:
click.confirm(
click.style(
f"Are you sure you want to remove {len(runs)} runs?",
bold=True,
),
... | python | wandb/cli/cli.py | 603 | 651 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,551 | sweep | def sweep(
ctx,
project,
entity,
controller,
verbose,
name,
program,
settings,
update,
launch_config, # TODO(gst): deprecate
stop,
cancel,
pause,
resume,
config_yaml_or_sweep_id,
queue,
project_queue,
):
state_args = "stop", "cancel", "pause", "re... | python | wandb/cli/cli.py | 718 | 1,031 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,552 | _parse_settings | def _parse_settings(settings):
"""Parse settings from json or comma separated assignments."""
ret = {}
# TODO(jhr): merge with magic:_parse_magic
if settings.find("=") > 0:
for item in settings.split(","):
kv = item.split("=")
if len(kv) != 2:
... | python | wandb/cli/cli.py | 773 | 787 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,553 | launch | def launch(
uri,
job,
entry_point,
git_version,
args_list,
name,
resource,
entity,
project,
docker_image,
config,
queue,
run_async,
resource_args,
build,
repository,
project_queue,
):
"""Start a W&B run from the given URI.
The URI can bea wand... | python | wandb/cli/cli.py | 1,168 | 1,297 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,554 | launch_agent | def launch_agent(
ctx,
project=None,
entity=None,
queues=None,
max_jobs=None,
config=None,
url=None,
):
logger.info(
f"=== Launch-agent called with kwargs {locals()} CLI Version: {wandb.__version__} ==="
)
wandb._sentry.configure_scope(process_context="launch_agent")
... | python | wandb/cli/cli.py | 1,344 | 1,388 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,555 | agent | def agent(ctx, project, entity, count, sweep_id):
api = _get_cling_api()
if api.api_key is None:
wandb.termlog("Login to W&B to use the sweep agent feature")
ctx.invoke(login, no_offline=True)
api = _get_cling_api(reset=True)
wandb.termlog("Starting wandb agent 🕵️")
wandb_agent... | python | wandb/cli/cli.py | 1,400 | 1,412 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,556 | scheduler | def scheduler(
ctx,
sweep_id,
):
api = _get_cling_api()
if api.api_key is None:
wandb.termlog("Login to W&B to use the sweep scheduler feature")
ctx.invoke(login, no_offline=True)
api = _get_cling_api(reset=True)
wandb._sentry.configure_scope(process_context="sweep_scheduler... | python | wandb/cli/cli.py | 1,421 | 1,455 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,557 | controller | def controller(verbose, sweep_id):
click.echo("Starting wandb controller...")
from wandb import controller as wandb_controller
tuner = wandb_controller(sweep_id)
tuner.run(verbose=verbose) | python | wandb/cli/cli.py | 1,462 | 1,467 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,558 | docker_run | def docker_run(ctx, docker_run_args):
"""Wrap `docker run` and adds WANDB_API_KEY and WANDB_DOCKER environment variables.
This will also set the runtime to nvidia if the nvidia-docker executable is present
on the system and --runtime wasn't set.
See `docker run --help` for more details.
"""
ap... | python | wandb/cli/cli.py | 1,473 | 1,507 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,559 | docker | def docker(
ctx,
docker_run_args,
docker_image,
nvidia,
digest,
jupyter,
dir,
no_dir,
shell,
port,
cmd,
no_tty,
):
"""Run your code in a docker container.
W&B docker lets you run your code in a docker image ensuring wandb is configured. It
adds the WANDB_DOCK... | python | wandb/cli/cli.py | 1,538 | 1,647 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,560 | local | def local(ctx, *args, **kwargs):
wandb.termwarn("`wandb local` has been replaced with `wandb server start`.")
ctx.invoke(start, *args, **kwargs) | python | wandb/cli/cli.py | 1,670 | 1,672 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,561 | server | def server():
pass | python | wandb/cli/cli.py | 1,676 | 1,677 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,562 | start | def start(ctx, port, env, daemon, upgrade, edge):
api = InternalApi()
if not find_executable("docker"):
raise ClickException("Docker not installed, install it from https://docker.com")
local_image_sha = wandb.docker.image_id("wandb/local").split("wandb/local")[-1]
registry_image_sha = wandb.dock... | python | wandb/cli/cli.py | 1,702 | 1,769 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,563 | stop | def stop():
if not find_executable("docker"):
raise ClickException("Docker not installed, install it from https://docker.com")
subprocess.call(["docker", "stop", "wandb-local"]) | python | wandb/cli/cli.py | 1,773 | 1,776 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,564 | artifact | def artifact():
pass | python | wandb/cli/cli.py | 1,780 | 1,781 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,565 | put | def put(path, name, description, type, alias):
if name is None:
name = os.path.basename(path)
public_api = PublicApi()
entity, project, artifact_name = public_api._parse_artifact_path(name)
if project is None:
project = click.prompt("Enter the name of the project you want to use")
# ... | python | wandb/cli/cli.py | 1,799 | 1,868 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,566 | get | def get(path, root, type):
public_api = PublicApi()
entity, project, artifact_name = public_api._parse_artifact_path(path)
if project is None:
project = click.prompt("Enter the name of the project you want to use")
try:
artifact_parts = artifact_name.split(":")
if len(artifact_p... | python | wandb/cli/cli.py | 1,876 | 1,901 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,567 | ls | def ls(path, type):
public_api = PublicApi()
if type is not None:
types = [public_api.artifact_type(type, path)]
else:
types = public_api.artifact_types(path)
for kind in types:
for collection in kind.collections():
versions = public_api.artifact_versions(
... | python | wandb/cli/cli.py | 1,910 | 1,932 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,568 | cache | def cache():
pass | python | wandb/cli/cli.py | 1,936 | 1,937 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,569 | cleanup | def cleanup(target_size):
target_size = util.from_human_size(target_size)
cache = wandb_sdk.wandb_artifacts.get_artifacts_cache()
reclaimed_bytes = cache.cleanup(target_size)
print(f"Reclaimed {util.to_human_size(reclaimed_bytes)} of space") | python | wandb/cli/cli.py | 1,946 | 1,950 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,570 | pull | def pull(run, project, entity):
api = InternalApi()
project, run = api.parse_slug(run, project=project)
urls = api.download_urls(project, run=run, entity=entity)
if len(urls) == 0:
raise ClickException("Run has no files")
click.echo(
"Downloading: {project}/{run}".format(
... | python | wandb/cli/cli.py | 1,966 | 1,996 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,571 | restore | def restore(ctx, run, no_git, branch, project, entity):
from wandb.old.core import wandb_dir
api = _get_cling_api()
if ":" in run:
if "/" in run:
entity, rest = run.split("/", 1)
else:
rest = run
project, run = rest.split(":", 1)
elif run.count("/") > 1:
... | python | wandb/cli/cli.py | 2,017 | 2,147 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,572 | magic | def magic(ctx, program, args):
def magic_run(cmd, globals, locals):
try:
exec(cmd, globals, locals)
finally:
pass
sys.argv[:] = args
sys.argv.insert(0, program)
sys.path.insert(0, os.path.dirname(program))
try:
with open(program, "rb") as fp:
... | python | wandb/cli/cli.py | 2,155 | 2,186 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,573 | magic_run | def magic_run(cmd, globals, locals):
try:
exec(cmd, globals, locals)
finally:
pass | python | wandb/cli/cli.py | 2,156 | 2,160 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,574 | online | def online():
api = InternalApi()
try:
api.clear_setting("disabled", persist=True)
api.clear_setting("mode", persist=True)
except configparser.Error:
pass
click.echo(
"W&B online. Running your script from this directory will now sync to the cloud."
) | python | wandb/cli/cli.py | 2,191 | 2,200 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,575 | offline | def offline():
api = InternalApi()
try:
api.set_setting("disabled", "true", persist=True)
api.set_setting("mode", "offline", persist=True)
click.echo(
"W&B offline. Running your script from this directory will only write metadata locally. Use wandb disabled to completely turn... | python | wandb/cli/cli.py | 2,205 | 2,216 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,576 | on | def on(ctx):
ctx.invoke(online) | python | wandb/cli/cli.py | 2,222 | 2,223 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,577 | off | def off(ctx):
ctx.invoke(offline) | python | wandb/cli/cli.py | 2,229 | 2,230 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,578 | status | def status(settings):
api = _get_cling_api()
if settings:
click.echo(click.style("Current Settings", bold=True))
settings = api.settings()
click.echo(
json.dumps(settings, sort_keys=True, indent=2, separators=(",", ": "))
) | python | wandb/cli/cli.py | 2,237 | 2,244 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,579 | disabled | def disabled(service):
api = InternalApi()
try:
api.set_setting("mode", "disabled", persist=True)
click.echo("W&B disabled.")
os.environ[wandb.env._DISABLE_SERVICE] = str(service)
except configparser.Error:
click.echo(
"Unable to write config, copy and paste the f... | python | wandb/cli/cli.py | 2,255 | 2,264 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,580 | enabled | def enabled(service):
api = InternalApi()
try:
api.set_setting("mode", "online", persist=True)
click.echo("W&B enabled.")
os.environ[wandb.env._DISABLE_SERVICE] = str(not service)
except configparser.Error:
click.echo(
"Unable to write config, copy and paste the f... | python | wandb/cli/cli.py | 2,275 | 2,284 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,581 | gc | def gc(args):
click.echo(
"`wandb gc` command has been removed. Use `wandb sync --clean` to clean up synced runs."
) | python | wandb/cli/cli.py | 2,289 | 2,292 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,582 | verify | def verify(host):
# TODO: (kdg) Build this all into a WandbVerify object, and clean this up.
os.environ["WANDB_SILENT"] = "true"
os.environ["WANDB_PROJECT"] = "verify"
api = _get_cling_api()
reinit = False
if host is None:
host = api.settings("base_url")
print(f"Default host sele... | python | wandb/cli/cli.py | 2,297 | 2,346 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,583 | importer | def importer():
pass | python | wandb/cli/cli.py | 2,350 | 2,351 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,584 | mlflow | def mlflow(mlflow_tracking_uri, target_entity, target_project):
from wandb.apis.importers import MlflowImporter
importer = MlflowImporter(mlflow_tracking_uri=mlflow_tracking_uri)
overrides = {
"entity": target_entity,
"project": target_project,
}
importer.import_all_parallel(overri... | python | wandb/cli/cli.py | 2,364 | 2,373 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,585 | __init__ | def __init__(self, message, status_code: int = 500):
Exception.__init__(self)
self.message = message
self.status_code = status_code | python | wandb/testing/relay.py | 64 | 67 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,586 | get_response | def get_response(self):
return flask.Response(self.message, status=self.status_code) | python | wandb/testing/relay.py | 69 | 70 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,587 | __repr__ | def __repr__(self):
return f"DeliberateHTTPError({self.message!r}, {self.status_code!r})" | python | wandb/testing/relay.py | 72 | 73 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,588 | __init__ | def __init__(self) -> None:
self.start: float = time.perf_counter()
self.stop: float = self.start | python | wandb/testing/relay.py | 77 | 79 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,589 | __enter__ | def __enter__(self) -> "Timer":
return self | python | wandb/testing/relay.py | 81 | 82 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,590 | __exit__ | def __exit__(self, *args: Any) -> None:
self.stop = time.perf_counter() | python | wandb/testing/relay.py | 84 | 85 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,591 | elapsed | def elapsed(self) -> float:
return self.stop - self.start | python | wandb/testing/relay.py | 88 | 89 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,592 | __init__ | def __init__(self) -> None:
# parsed/merged data. keys are the individual wandb run id's.
self._entries = defaultdict(dict)
# container for raw requests and responses:
self.raw_data: List["RawRequestResponse"] = []
# concatenated file contents for all runs:
self._history:... | python | wandb/testing/relay.py | 99 | 108 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,593 | upsert | def upsert(self, entry: Dict[str, Any]) -> None:
entry_id: str = entry["name"]
self._entries[entry_id] = wandb.util.merge_dicts(entry, self._entries[entry_id]) | python | wandb/testing/relay.py | 110 | 112 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,594 | __getitem__ | def __getitem__(self, key: str) -> Any:
return self._entries[key] | python | wandb/testing/relay.py | 115 | 116 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,595 | keys | def keys(self) -> Iterable[str]:
return self._entries.keys() | python | wandb/testing/relay.py | 118 | 119 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,596 | get_file_contents | def get_file_contents(self, file_name: str) -> pd.DataFrame:
dfs = []
for entry_id in self._entries:
# - extract the content from `file_name`
# - sort by offset (will be useful when relay server goes async)
# - extract data, merge into a list of dicts and convert to ... | python | wandb/testing/relay.py | 121 | 137 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,597 | entries | def entries(self) -> Dict[str, Any]:
return deepcopy(self._entries) | python | wandb/testing/relay.py | 141 | 142 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,598 | history | def history(self) -> pd.DataFrame:
# todo: caveat: this assumes that all assertions happen at the end of a test
if self._history is not None:
return deepcopy(self._history)
self._history = self.get_file_contents("wandb-history.jsonl")
return deepcopy(self._history) | python | wandb/testing/relay.py | 145 | 151 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,599 | events | def events(self) -> pd.DataFrame:
if self._events is not None:
return deepcopy(self._events)
self._events = self.get_file_contents("wandb-events.jsonl")
return deepcopy(self._events) | python | wandb/testing/relay.py | 154 | 159 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
2,600 | summary | def summary(self) -> pd.DataFrame:
if self._summary is not None:
return deepcopy(self._summary)
_summary = self.get_file_contents("wandb-summary.json")
# run summary may be updated multiple times,
# but we are only interested in the last one.
# we can have multiple ... | python | wandb/testing/relay.py | 162 | 177 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.