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 |
|---|---|---|---|---|---|---|---|
701 | mssql_backend | def mssql_backend():
... | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 194 | 195 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
702 | mysql_backend | def mysql_backend():
... | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 199 | 200 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
703 | postgres_backend | def postgres_backend():
... | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 204 | 205 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
704 | file_backend | def file_backend(tmp_path):
yield tmp_path / "mlruns" | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 209 | 210 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
705 | sqlite_backend | def sqlite_backend():
yield "sqlite:///mlflow.db" | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 214 | 215 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
706 | mlflow_backend | def mlflow_backend(request):
yield request.getfixturevalue(request.param) | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 228 | 229 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
707 | file_artifacts | def file_artifacts(tmp_path):
yield tmp_path / "mlartifacts" | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 233 | 234 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
708 | s3_artifacts | def s3_artifacts():
yield ... | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 238 | 239 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
709 | mlflow_artifacts_destination | def mlflow_artifacts_destination(request):
yield request.getfixturevalue(request.param) | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 248 | 249 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
710 | get_free_port | def get_free_port():
import socket
sock = socket.socket()
sock.bind(("", 0))
return str(sock.getsockname()[1]) | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 252 | 257 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
711 | mlflow_server | def mlflow_server(mlflow_backend, mlflow_artifacts_destination):
new_port = get_free_port()
modified_base_url = MLFLOW_BASE_URL.replace("4040", new_port)
start_cmd = [
"mlflow",
"server",
"-p",
new_port,
"--backend-store-uri",
mlflow_backend,
"--artif... | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 261 | 285 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
712 | prelogged_mlflow_server | def prelogged_mlflow_server(mlflow_server):
log_to_mlflow(mlflow_server, EXPERIMENTS, RUNS_PER_EXPERIMENT, STEPS)
yield mlflow_server, EXPERIMENTS, RUNS_PER_EXPERIMENT, STEPS | python | tests/pytest_tests/system_tests/test_importers/conftest.py | 289 | 291 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
713 | teardown | def teardown():
yield
wandb.finish()
if os.path.isdir("wandb"):
shutil.rmtree("wandb")
if os.path.isdir("artifacts"):
shutil.rmtree("artifacts") | python | tests/standalone_tests/artifact_benchmark.py | 14 | 20 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
714 | test_benchmark_upload_artifact | def test_benchmark_upload_artifact(
tmp_path: pathlib.Path,
benchmark,
_async_upload_concurrency_limit: Optional[int],
num_files: int,
):
data_dir = tmp_path / "data"
data_dir.mkdir()
num_file_digits = len(str(num_files - 1))
for filenum in range(num_files):
(data_dir / f"file{fi... | python | tests/standalone_tests/artifact_benchmark.py | 25 | 52 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
715 | main | def main():
wandb.init(name=pathlib.Path(__file__).stem)
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Conv2D(3, 3, activation="relu", input_shape=(28, 28, 1)))
model.add(tf.keras.layers.Flatten())
model.add(tf.keras.layers.Dense(10, activation="softmax"))
model.compile(
... | python | tests/standalone_tests/mixed_keras.py | 10 | 27 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
716 | main | def main():
run = wandb.init()
print("config", wandb.config)
print("resumed", run.resumed)
config_len = len(wandb.config.keys())
conf_update = {}
conf_update[str(config_len)] = random.random()
wandb.config.update(conf_update) | python | tests/standalone_tests/resume-empty.py | 10 | 17 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
717 | update_versions | def update_versions(version=1):
root = f"./versions{version}"
os.makedirs(root, exist_ok=True)
with open(f"{root}/every.txt", "w") as f:
f.write(f"{PREFIX} every version {version}")
if version % 2 == 0:
with open(f"{root}/even.txt", "w") as f:
f.write(f"{PREFIX} even version ... | python | tests/standalone_tests/artifact_references.py | 20 | 31 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
718 | sync_buckets | def sync_buckets(root):
# Sync up
os.system(f"gsutil rsync {root} {GCS_REMOTE}")
os.system(f"aws s3 sync {root} {S3_REMOTE}")
# Sync down
os.system(f"gsutil rsync {GCS_REMOTE} {root}")
os.system(f"aws s3 sync {S3_REMOTE} {root}") | python | tests/standalone_tests/artifact_references.py | 34 | 40 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
719 | log_artifacts | def log_artifacts():
gcs_art = wandb.Artifact(name=GCS_NAME, type="dataset")
s3_art = wandb.Artifact(name=S3_NAME, type="dataset")
gcs_art.add_reference(GCS_REMOTE)
s3_art.add_reference(S3_REMOTE)
run = wandb.init(project="artifact-references", entity=ENTITY, reinit=True)
run.log_artifact(gcs_ar... | python | tests/standalone_tests/artifact_references.py | 43 | 51 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
720 | download_artifacts | def download_artifacts(gcs_alias="v0", s3_alias="v0"):
api = wandb.Api()
gcs_art = api.artifact(
name=f"{ENTITY}/artifact-references/{GCS_NAME}:{gcs_alias}", type="dataset"
)
s3_art = api.artifact(
name=f"{ENTITY}/artifact-references/{S3_NAME}:{s3_alias}", type="dataset"
)
gcs_ar... | python | tests/standalone_tests/artifact_references.py | 54 | 64 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
721 | main | def main(argv):
v1_root = update_versions()
sync_buckets(v1_root)
log_artifacts()
v2_root = update_versions(2)
sync_buckets(v2_root)
log_artifacts()
print("Sleeping for arts to get processed...")
time.sleep(1)
gcs_v1_art, s3_v1_art = download_artifacts()
gcs_v2_art, s3_v2_art =... | python | tests/standalone_tests/artifact_references.py | 67 | 116 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
722 | gen_point | def gen_point(theta, chi, i):
p = sin(theta) * 4.5 * sin(i + 1 / 2 * (i * i + 2)) + cos(chi) * 7 * sin(
(2 * i - 4) / 2 * (i + 2)
)
x = p * sin(chi) * cos(theta)
y = p * sin(chi) * sin(theta)
z = p * cos(chi)
r = sin(theta) * 120 + 120
g = sin(x) * 120 + 120
b = cos(y) * 120 + ... | python | tests/standalone_tests/point_cloud.py | 29 | 42 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
723 | wave_pattern | def wave_pattern(i):
return np.array([gen_point(theta, chi, i) for [theta, chi] in theta_chi]) | python | tests/standalone_tests/point_cloud.py | 45 | 46 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
724 | main | def main():
run = wandb.init()
# Tests 3d OBJ
# wandb.log({"gltf": wandb.Object3D(open(os.path.join(DIR, "assets", "Duck.gltf"))),
# "obj": wandb.Object3D(open(os.path.join(DIR, "assets", "cube.obj")))})
artifact = wandb.Artifact("pointcloud_test_2", "dataset")
table = wandb.Table(
... | python | tests/standalone_tests/point_cloud.py | 49 | 76 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
725 | main | def main():
# wandb.init(project="tf2", sync_tensorboard=True, resume=True)
wandb.init(sync_tensorboard=True, resume=True)
wandb.config["nice"] = "So cool fun"
class Logger(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs):
time.sleep(2)
wandb.log({"wild... | python | tests/standalone_tests/keras_tensorboard.py | 8 | 33 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
726 | on_epoch_end | def on_epoch_end(self, epoch, logs):
time.sleep(2)
wandb.log({"wild_metrics": logs, "interval": epoch * 10}) | python | tests/standalone_tests/keras_tensorboard.py | 15 | 17 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
727 | make_scene | def make_scene(vecs):
return wandb.Object3D(
{
"type": "lidar/beta",
"vectors": np.array(vecs),
"points": points,
"boxes": np.array(
[
{
"corners": [
[0, 0, 0],
... | python | tests/standalone_tests/point_cloud_scene.py | 14 | 53 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
728 | main | def main():
vectors = [
{"start": [1, 1, 1], "end": [1, 1.5, 1]},
{"start": [1, 1, 1], "end": [1, 1, 1.5]},
{"start": [1, 1, 1], "end": [1.2, 1.5, 1.5]},
]
vectors_2 = [
{"start": [2, 2, 2], "end": [1, 1.5, 1], "color": [255, 255, 0]},
{
"start": [2, 2, 2... | python | tests/standalone_tests/point_cloud_scene.py | 56 | 81 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
729 | get_init_count | def get_init_count():
global init_count
current_count = init_count
init_count += 1
return current_count | python | tests/standalone_tests/artifact_tests.py | 13 | 17 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
730 | teardown | def teardown():
wandb.finish()
if os.path.isdir("wandb"):
shutil.rmtree("wandb")
if os.path.isdir("artifacts"):
shutil.rmtree("artifacts") | python | tests/standalone_tests/artifact_tests.py | 20 | 25 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
731 | _run_eq | def _run_eq(run_a, run_b):
return (
run_a.id == run_b.id
and run_a.entity == run_b.entity
and run_a.project == run_b.project
) | python | tests/standalone_tests/artifact_tests.py | 28 | 33 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
732 | _runs_eq | def _runs_eq(runs_a, runs_b):
return all([_run_eq(run_a, run_b) for run_a, run_b in zip(runs_a, runs_b)]) | python | tests/standalone_tests/artifact_tests.py | 36 | 37 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
733 | test_artifact_run_lookup_apis | def test_artifact_run_lookup_apis():
artifact_1_name = f"a1-{str(time.time())}"
artifact_2_name = f"a2-{str(time.time())}"
# Initial setup
run_1 = wandb.init(name=f"{run_name_base}-{get_init_count()}")
artifact = wandb.Artifact(artifact_1_name, "test_type")
artifact.add(wandb.Image(np.random.ra... | python | tests/standalone_tests/artifact_tests.py | 40 | 77 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
734 | test_artifact_creation_with_diff_type | def test_artifact_creation_with_diff_type():
artifact_name = f"a1-{str(time.time())}"
# create
with wandb.init(name=f"{run_name_base}-{get_init_count()}") as run:
artifact = wandb.Artifact(artifact_name, "artifact_type_1")
artifact.add(wandb.Image(np.random.randint(0, 255, (10, 10))), "imag... | python | tests/standalone_tests/artifact_tests.py | 80 | 117 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
735 | random_image | def random_image():
return wandb.Image(np.random.randint(255, size=(32, 32))) | python | tests/standalone_tests/offline_artifacts.py | 25 | 26 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
736 | make_dataset | def make_dataset():
return wandb.Table(
data=[[str(i), random_image()] for i in range(dataset_size)],
columns=["id", "input_image"],
) | python | tests/standalone_tests/offline_artifacts.py | 29 | 33 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
737 | make_linked_table | def make_linked_table(dataset):
tab = wandb.Table(
data=[
[str(np.random.choice(range(dataset_size)).tolist()), i, random_image()]
for i in range(pred_size)
],
columns=["fk_id", "tab_id", "pred_img"],
)
tab.set_fk("fk_id", dataset, "id")
return tab | python | tests/standalone_tests/offline_artifacts.py | 36 | 45 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
738 | make_run | def make_run():
return wandb.init(project=project, mode=mode) | python | tests/standalone_tests/offline_artifacts.py | 48 | 49 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
739 | init_dataset_run | def init_dataset_run():
run = make_run()
dataset = make_dataset()
art = wandb.Artifact("A", "B")
art.add(dataset, "dataset")
run.log_artifact(art)
run.finish()
return dataset | python | tests/standalone_tests/offline_artifacts.py | 55 | 62 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
740 | init_ref_dataset_run | def init_ref_dataset_run():
run = make_run()
dataset = make_dataset()
tab = make_linked_table(dataset)
run.log({"tab": tab})
run.finish()
return dataset | python | tests/standalone_tests/offline_artifacts.py | 65 | 71 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
741 | do_ref_dataset_run_grouped | def do_ref_dataset_run_grouped():
run = make_run()
dataset = make_dataset()
tab = make_linked_table(dataset)
run.log({"dataset": dataset, "tab": tab})
run.finish()
return dataset | python | tests/standalone_tests/offline_artifacts.py | 77 | 83 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
742 | do_ref_dataset_run_ordered | def do_ref_dataset_run_ordered():
run = make_run()
dataset = make_dataset()
tab = make_linked_table(dataset)
run.log({"dataset": dataset})
run.log({"tab": tab})
run.finish()
return dataset | python | tests/standalone_tests/offline_artifacts.py | 86 | 93 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
743 | do_ref_dataset_run_reversed | def do_ref_dataset_run_reversed():
run = make_run()
dataset = make_dataset()
tab = make_linked_table(dataset)
run.log({"tab": tab})
run.log({"dataset": dataset})
run.finish()
return dataset | python | tests/standalone_tests/offline_artifacts.py | 96 | 103 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
744 | do_dep_dataset_run | def do_dep_dataset_run():
dataset = init_dataset_run()
run = make_run()
run.log({"dataset": dataset})
run.finish()
return run | python | tests/standalone_tests/offline_artifacts.py | 109 | 114 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
745 | do_dep_ref_dataset_run | def do_dep_ref_dataset_run():
dataset = init_dataset_run()
run = make_run()
tab = make_linked_table(dataset)
run.log({"tab": tab})
run.finish()
return run | python | tests/standalone_tests/offline_artifacts.py | 117 | 123 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
746 | do_dep_ref_dataset_run_grouped | def do_dep_ref_dataset_run_grouped():
dataset = init_dataset_run()
run = make_run()
tab = make_linked_table(dataset)
run.log({"dataset": dataset, "tab": tab})
run.finish()
return run | python | tests/standalone_tests/offline_artifacts.py | 126 | 132 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
747 | do_dep_ref_dataset_run_ordered | def do_dep_ref_dataset_run_ordered():
dataset = init_dataset_run()
run = make_run()
tab = make_linked_table(dataset)
run.log({"dataset": dataset})
run.log({"tab": tab})
run.finish()
return run | python | tests/standalone_tests/offline_artifacts.py | 135 | 142 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
748 | do_dep_ref_dataset_run_reversed | def do_dep_ref_dataset_run_reversed():
dataset = init_dataset_run()
run = make_run()
tab = make_linked_table(dataset)
run.log({"tab": tab})
run.log({"dataset": dataset})
run.finish()
return run | python | tests/standalone_tests/offline_artifacts.py | 145 | 152 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
749 | do_r_dep_dataset_run | def do_r_dep_dataset_run():
dataset = init_ref_dataset_run()
run = make_run()
run.log({"dataset": dataset})
run.finish()
return run | python | tests/standalone_tests/offline_artifacts.py | 158 | 163 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
750 | do_r_dep_ref_dataset_run | def do_r_dep_ref_dataset_run():
dataset = init_ref_dataset_run()
run = make_run()
tab = make_linked_table(dataset)
run.log({"tab": tab})
run.finish()
return run | python | tests/standalone_tests/offline_artifacts.py | 166 | 172 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
751 | do_r_dep_ref_dataset_run_grouped | def do_r_dep_ref_dataset_run_grouped():
dataset = init_ref_dataset_run()
run = make_run()
tab = make_linked_table(dataset)
run.log({"dataset": dataset, "tab": tab})
run.finish()
return run | python | tests/standalone_tests/offline_artifacts.py | 175 | 181 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
752 | do_r_dep_ref_dataset_run_ordered | def do_r_dep_ref_dataset_run_ordered():
dataset = init_ref_dataset_run()
run = make_run()
tab = make_linked_table(dataset)
run.log({"dataset": dataset})
run.log({"tab": tab})
run.finish()
return run | python | tests/standalone_tests/offline_artifacts.py | 184 | 191 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
753 | do_r_dep_ref_dataset_run_reversed | def do_r_dep_ref_dataset_run_reversed():
dataset = init_ref_dataset_run()
run = make_run()
tab = make_linked_table(dataset)
run.log({"tab": tab})
run.log({"dataset": dataset})
run.finish()
return run | python | tests/standalone_tests/offline_artifacts.py | 194 | 201 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
754 | sync_all | def sync_all():
print("Syncing...")
ctx = CliRunner()
result = ctx.invoke(cli.sync, args=["--sync-all"])
assert result.exit_code == 0
print("...Syncing Complete") | python | tests/standalone_tests/offline_artifacts.py | 204 | 209 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
755 | main | def main():
# Base Cases
init_dataset_run()
init_ref_dataset_run()
# Alt Log Ordering
do_ref_dataset_run_grouped()
do_ref_dataset_run_ordered()
do_ref_dataset_run_reversed()
# Depend on base case 1
do_dep_dataset_run()
do_dep_ref_dataset_run()
do_dep_ref_dataset_run_grouped... | python | tests/standalone_tests/offline_artifacts.py | 212 | 235 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
756 | main | def main(args):
run_id = runid.generate_id()
try:
wandb.init(project="resuming", resume="must", id=run_id)
except wandb.Error:
print("Confirmed we can't resume a non-existent run with must")
wandb.init(project="resuming", resume="allow", id=run_id)
print("Run start time: ", wandb.ru... | python | tests/standalone_tests/resuming_and_reinit.py | 8 | 51 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
757 | poke | def poke():
f = requests.get(URL)
data = f.text
print("GOT:", data) | python | tests/standalone_tests/sweep_check.py | 18 | 21 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
758 | train | def train(**kwargs):
print("train", kwargs)
if kwargs.get("chdir"):
try:
os.makedirs("./test_chdir")
except Exception as e:
print(e)
os.chdir("./test_chdir")
run = wandb.init()
with run:
c = dict(run.config)
run.name = "{}-{}-{}".format(c.g... | python | tests/standalone_tests/sweep_check.py | 24 | 49 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
759 | train_and_check_chdir | def train_and_check_chdir(**kwargs):
if "test_chdir" not in os.getcwd():
try:
os.makedirs("./test_chdir")
except Exception as e:
print(e)
os.chdir("./test_chdir")
run = wandb.init()
with run:
c = dict(run.config)
run.name = "{}-{}-{}".format(c.... | python | tests/standalone_tests/sweep_check.py | 53 | 84 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
760 | check | def check(sweep_id, num=None, result=None, stopped=None):
settings = wandb.InternalApi().settings()
api = wandb.Api(overrides=settings)
sweep = api.sweep(f"{PROJECT}/{sweep_id}")
runs = sorted(
sweep.runs, key=lambda run: run.summary.get("val_acc", 0), reverse=True
)
if num is not None:
... | python | tests/standalone_tests/sweep_check.py | 87 | 112 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
761 | sweep_quick | def sweep_quick(args):
config = dict(
method="random",
parameters=dict(
param0=dict(values=[2]),
param1=dict(values=[0, 1, 4]),
param2=dict(values=[0, 0.5, 1.5]),
epochs=dict(value=4),
),
)
sweep_id = wandb.sweep(config, project=PROJECT... | python | tests/standalone_tests/sweep_check.py | 115 | 128 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
762 | sweep_grid | def sweep_grid(args):
config = dict(
method="grid",
parameters=dict(
param0=dict(values=[2]),
param1=dict(values=[0, 1, 4]),
param2=dict(values=[0, 0.5, 1.5]),
epochs=dict(value=4),
),
)
sweep_id = wandb.sweep(config, project=PROJECT)
... | python | tests/standalone_tests/sweep_check.py | 131 | 144 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
763 | sweep_bayes | def sweep_bayes(args):
config = dict(
method="bayes",
metric=dict(name="val_acc", goal="maximize"),
parameters=dict(
param0=dict(values=[2]),
param1=dict(values=[0, 1, 4]),
param2=dict(values=[0, 0.5, 1.5]),
),
)
sweep_id = wandb.sweep(conf... | python | tests/standalone_tests/sweep_check.py | 147 | 160 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
764 | sweep_bayes_nested | def sweep_bayes_nested(args):
config = dict(
method="bayes",
metric=dict(name="feat1.val_acc", goal="maximize"),
parameters=dict(
param0=dict(values=[2]),
param1=dict(values=[0, 1, 4]),
param2=dict(values=[0, 0.5, 1.5]),
),
)
sweep_id = wan... | python | tests/standalone_tests/sweep_check.py | 163 | 176 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
765 | sweep_grid_hyperband | def sweep_grid_hyperband(args):
config = dict(
method="grid",
metric=dict(name="val_acc", goal="maximize"),
parameters=dict(
param0=dict(values=[2]),
param1=dict(values=[4, 1, 0]),
param2=dict(values=[1.5, 0.5, 0]),
delay=dict(value=args.grid_h... | python | tests/standalone_tests/sweep_check.py | 179 | 196 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
766 | sweep_chdir | def sweep_chdir(args):
config = dict(
method="grid",
parameters=dict(
param0=dict(values=[2]),
param1=dict(values=[0, 1, 4]),
param2=dict(values=[0, 0.5, 1.5]),
epochs=dict(value=4),
),
root=os.getcwd(),
)
sweep_id = wandb.swee... | python | tests/standalone_tests/sweep_check.py | 200 | 216 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
767 | main | def main():
global POKE_LOCAL
# os.environ["WANDB_DEBUG"] = "true"
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--test", default="", type=str)
parser.add_argument("-x", "--exclude", default="", type=str)
parser.add_argument("--grid_hyper_delay", type=int)
parser.add_argument... | python | tests/standalone_tests/sweep_check.py | 219 | 253 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
768 | make_exit_data | def make_exit_data(data):
edata = wandb_internal_pb2.RunExitRecord()
edata.exit_code = data.get("exit_code", 0)
return edata | python | tests/standalone_tests/grpc_client.py | 27 | 30 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
769 | make_log_data | def make_log_data(data):
hdata = wandb_internal_pb2.HistoryRecord()
for k, v in data.items():
item = hdata.item.add()
item.key = k
item.value_json = json.dumps(v)
return hdata | python | tests/standalone_tests/grpc_client.py | 33 | 39 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
770 | make_config | def make_config(config_dict, obj=None):
config = obj or wandb_internal_pb2.ConfigRecord()
for k, v in config_dict.items():
update = config.update.add()
update.key = k
update.value_json = json.dumps(v)
return config | python | tests/standalone_tests/grpc_client.py | 42 | 48 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
771 | _pbmap_apply_dict | def _pbmap_apply_dict(
m: "MessageMap[str, spb.SettingsValue]", d: Dict[str, Any]
) -> None:
for k, v in d.items():
if isinstance(v, datetime.datetime):
continue
if isinstance(v, enum.Enum):
continue
sv = spb.SettingsValue()
if v is None:
sv.nu... | python | tests/standalone_tests/grpc_client.py | 51 | 72 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
772 | make_settings | def make_settings(settings_dict, obj):
_pbmap_apply_dict(obj, settings_dict) | python | tests/standalone_tests/grpc_client.py | 75 | 76 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
773 | make_run_data | def make_run_data(data):
rdata = wandb_internal_pb2.RunRecord()
run_id = data.get("run_id")
if run_id:
rdata.run_id = run_id
entity = data.get("entity")
if entity:
rdata.entity = entity
project = data.get("project")
if project:
rdata.project = project
run_group = ... | python | tests/standalone_tests/grpc_client.py | 79 | 100 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
774 | make_summary | def make_summary(summary_dict, obj=None):
summary = obj or wandb_internal_pb2.SummaryRecord()
for k, v in summary_dict.items():
update = summary.update.add()
update.key = k
update.value_json = json.dumps(v)
return summary | python | tests/standalone_tests/grpc_client.py | 103 | 109 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
775 | make_output | def make_output(name, data):
if name == "stdout":
otype = wandb_internal_pb2.OutputRecord.OutputType.STDOUT
elif name == "stderr":
otype = wandb_internal_pb2.OutputRecord.OutputType.STDERR
else:
# TODO(jhr): throw error?
print("unknown type")
outdata = wandb_internal_pb2.... | python | tests/standalone_tests/grpc_client.py | 112 | 122 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
776 | __init__ | def __init__(self):
self._channel = None
self._stub = None
self._stream_id = None | python | tests/standalone_tests/grpc_client.py | 126 | 129 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
777 | connect | def connect(self):
channel = grpc.insecure_channel("localhost:50051")
stub = wandb_server_pb2_grpc.InternalServiceStub(channel)
self._channel = channel
self._stub = stub | python | tests/standalone_tests/grpc_client.py | 131 | 135 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
778 | _apply_stream | def _apply_stream(self, obj):
assert self._stream_id
obj._info.stream_id = self._stream_id | python | tests/standalone_tests/grpc_client.py | 137 | 139 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
779 | _inform_init | def _inform_init(self, settings):
# only do this once
if self._stream_id:
return
run_id = settings.run_id
assert run_id
self._stream_id = run_id
settings_dict = dict(settings)
settings_dict["_log_level"] = logging.DEBUG
req = spb.ServerInform... | python | tests/standalone_tests/grpc_client.py | 141 | 155 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
780 | run_start | def run_start(self, run_id):
settings = wandb.Settings()
settings._set_run_start_time()
settings.update(run_id=run_id)
files_dir = settings.files_dir
os.makedirs(files_dir)
log_user = settings.log_user
os.makedirs(log_user)
self._inform_init(settings) | python | tests/standalone_tests/grpc_client.py | 157 | 165 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
781 | run_update | def run_update(self, data):
req = make_run_data(data)
self._apply_stream(req)
run = self._stub.RunUpdate(req)
return run | python | tests/standalone_tests/grpc_client.py | 167 | 171 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
782 | log | def log(self, data):
req = make_log_data(data)
self._apply_stream(req)
_ = self._stub.Log(req) | python | tests/standalone_tests/grpc_client.py | 173 | 176 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
783 | config | def config(self, data):
req = make_config(data)
self._apply_stream(req)
_ = self._stub.Config(req) | python | tests/standalone_tests/grpc_client.py | 178 | 181 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
784 | summary | def summary(self, data):
req = make_summary(data)
self._apply_stream(req)
_ = self._stub.Summary(req) | python | tests/standalone_tests/grpc_client.py | 183 | 186 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
785 | output | def output(self, outtype, data):
req = make_output(outtype, data)
self._apply_stream(req)
_ = self._stub.Output(req) | python | tests/standalone_tests/grpc_client.py | 188 | 191 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
786 | exit | def exit(self, data):
req = make_exit_data(data)
self._apply_stream(req)
_ = self._stub.RunExit(req) | python | tests/standalone_tests/grpc_client.py | 193 | 196 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
787 | server_status | def server_status(self):
req = spb.ServerStatusRequest()
_ = self._stub.ServerStatus(req) | python | tests/standalone_tests/grpc_client.py | 198 | 200 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
788 | server_shutdown | def server_shutdown(self):
req = spb.ServerShutdownRequest()
_ = self._stub.ServerShutdown(req) | python | tests/standalone_tests/grpc_client.py | 202 | 204 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
789 | main | def main():
wic = WandbInternalClient()
wic.connect()
def_id = "junk123"
run_id = os.environ.get("WANDB_RUN_ID", def_id)
entity = os.environ.get("WANDB_ENTITY") # noqa: F841
project = os.environ.get("WANDB_PROJECT")
group = os.environ.get("WANDB_RUN_GROUP")
job_type = os.environ.get("W... | python | tests/standalone_tests/grpc_client.py | 220 | 263 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
790 | main | def main():
wandb.init(tensorboard=True)
class ConvNet(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
self.conv2_drop = nn.Dropout2d()
self.fc1 = nn... | python | tests/standalone_tests/pytorch_tensorboard.py | 8 | 38 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
791 | __init__ | def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
self.conv2_drop = nn.Dropout2d()
self.fc1 = nn.Linear(320, 50)
self.fc2 = nn.Linear(50, 10) | python | tests/standalone_tests/pytorch_tensorboard.py | 12 | 18 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
792 | forward | def forward(self, x):
x = F.relu(F.max_pool2d(self.conv1(x), 2))
x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2))
x = x.view(-1, 320)
x = F.relu(self.fc1(x))
x = F.dropout(x, training=self.training)
x = self.fc2(x)
return F.l... | python | tests/standalone_tests/pytorch_tensorboard.py | 20 | 27 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
793 | main | def main():
wandb.init(name=pathlib.Path(__file__).stem)
# Get a pandas DataFrame object of all the data in the csv file:
df = pd.read_csv(pathlib.Path(__file__).parent.resolve() / "tweets.csv")
# Get pandas Series object of the "tweet text" column:
text = df["tweet_text"]
# Get pandas Series... | python | tests/standalone_tests/tweets.py | 7 | 108 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
794 | main | def main(argv):
# wandb.init(entity="wandb", project="new-plots-test-5")
wandb.init(name=pathlib.Path(__file__).stem)
data = [[i, random.random() + math.sin(i / 10)] for i in range(100)]
table = wandb.Table(data=data, columns=["step", "height"])
line_plot = wandb.plot.line(
table, x="step", ... | python | tests/standalone_tests/basic_plots.py | 9 | 66 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
795 | main | def main():
wandb.init()
# We will use Shakespeare Sonnet 2
test_sentence = """When forty winters shall besiege thy brow,
And dig deep trenches in thy beauty's field,
Thy youth's proud livery so gazed on now,
Will be a totter'd weed of small worth held:
Then being asked, where all thy beaut... | python | tests/standalone_tests/sparse_tensors.py | 12 | 98 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
796 | __init__ | def __init__(self, vocab_size, embedding_dim, context_size):
super().__init__()
self.embeddings = nn.Embedding(vocab_size, embedding_dim, sparse=True)
self.linear1 = nn.Linear(context_size * embedding_dim, 128)
self.linear2 = nn.Linear(128, vocab_size) | python | tests/standalone_tests/sparse_tensors.py | 41 | 45 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
797 | forward | def forward(self, inputs):
embeds = self.embeddings(inputs).view((1, -1))
out = F.relu(self.linear1(embeds))
out = self.linear2(out)
log_probs = F.log_softmax(out, dim=1)
return log_probs | python | tests/standalone_tests/sparse_tensors.py | 47 | 52 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
798 | main | def main():
run = wandb.init()
config = run.config
config.img_size = 50
config.batch_size = 32
config.epochs = 0
config.train_path = os.path.join("simpsons", "train")
config.test_path = os.path.join("simpsons", "test")
# download the data if it doesn't exist
if not os.path.exists("s... | python | tests/standalone_tests/simpsons_data_frames.py | 24 | 188 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
799 | results_data_frame | def results_data_frame(test_datagen, model):
gen = test_datagen.flow_from_directory(
config.test_path,
target_size=(config.img_size, config.img_size),
batch_size=config.batch_size,
shuffle=False,
)
class_cols = []
class_names = []
... | python | tests/standalone_tests/simpsons_data_frames.py | 85 | 170 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
800 | on_epoch_end | def on_epoch_end(self, epoch, logs=None):
run.summary["results"] = results_data_frame(test_datagen, model) | python | tests/standalone_tests/simpsons_data_frames.py | 173 | 174 | {
"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.