def runner(monkeypatch, mocker): whaaaaat = util.vendor_import("whaaaaat") monkeypatch.setattr( 'wandb.cli.api', InternalApi(default_settings={ 'project': 'test', 'git_tag': True }, load_settings=False)) monkeypatch.setattr(click, 'launch', lambda x: 1) monkeypatch.setattr( whaaaaat, 'prompt', lambda x: { 'project_name': 'test_model', 'files': ['weights.h5'], 'attach': False, 'team_name': 'Manual Entry' }) monkeypatch.setattr(webbrowser, 'open_new_tab', lambda x: True) return CliRunner()
import logging import os import six from six.moves import queue import time from wandb import util import glob wd_polling = util.vendor_import("watchdog.observers.polling") wd_events = util.vendor_import("watchdog.events") logger = logging.getLogger(__file__) class FileEventHandler(object): def __init__(self, file_path, save_name, api, file_pusher, *args, **kwargs): self.file_path = file_path # Convert windows paths to unix paths save_name = util.to_forward_slash_path(save_name) self.save_name = save_name self._file_pusher = file_pusher self._last_sync = None self._api = api @property def synced(self): return self._last_sync == os.path.getmtime(self.file_path) @property
import textwrap import time import traceback import yaml import threading import random # pycreds has a find_executable that works in windows from dockerpycreds.utils import find_executable from wandb import util from click.utils import LazyFile from click.exceptions import BadParameter, ClickException, Abort # whaaaaat depends on prompt_toolkit < 2, ipython now uses > 2 so we vendored for now # DANGER this changes the sys.path so we should never do this in a user script whaaaaat = util.vendor_import("whaaaaat") import six from six.moves import BaseHTTPServer, urllib, configparser import socket from .core import termlog import wandb from wandb.apis import InternalApi from wandb.wandb_config import Config from wandb import agent as wandb_agent from wandb import wandb_controller from wandb import env from wandb import wandb_run from wandb import wandb_dir from wandb import run_manager