Loads a saved session variables, settings and test results to the shell.
762053
def do_load(self, arg):
        """"""
        from os import path
        import json
        fullpath = path.expanduser(arg)
        if path.isfile(fullpath):
            with open(fullpath) as f:
                data = json.load(f)

            #Now, reparse the staging directories that were present in the saved session.
            for stagepath in data["tests"]:
                self.do_parse(stagepath)
            self.args = data["args"]
1308343
function load () {
  const str = fs.readFileSync(settingsFile, 'utf8')
  if (str) {
    const settings = JSON.parse(str)
    this.settings = settings.livereload
    this.paths = getPaths(settings)
      .map(p => path.normalize(this.root + '/' + p))
      .map(p => makeGlob(p))
  }
}
1301601
function setup(done) {
    crontab.load(function(err, ct) {
      if (err) return done(err);
      clean(ct);
      load(ct);
      ct.save(done);
    });
  }
643617
def load_user():
    """"""
    config_path = get_user_config_path()
    config = {}

    # TODO: This may be overkill and too slow just for reading a config file
    with open(config_path) as f:
        code = compile(f.read(), config_path, 'exec')
    exec(code, config)

    keys = list(six.iterkeys(config))
    for k in keys:
        if k.startswith('_'):
            del config[k]

    return config
94202
protected void loadInterpolationValues() {
        // System properties may be accessed using ${name} or @{name}
        for (String propertyName : System.getProperties().stringPropertyNames()) {
            String value = System.getProperty(propertyName);
            if (!StringUtils.isNullOrEmpty(value)) {
                addInterpolationValue(propertyName, value);
            }
        }

        // Environment variables may be accessed using ${env.NAME} or @{env.NAME}
        for (String variableName : System.getenv().keySet()) {
            String value = System.getenv(variableName);
            if (!StringUtils.isNullOrEmpty(value)) {
                addInterpolationValue("env." + variableName, value);
            }
        }
    }
1097048
private function loadRoutineFile(): void
  {
    // Set magic constants specific for this stored routine.
    $this->setMagicConstants();

    // Replace all place holders with their values.
    $lines          = explode("\n", $this->routineSourceCode);
    $routine_source = [];
    foreach ($lines as $i => &$line)
    {
      $this->replace['__LINE__'] = $i + 1;
      $routine_source[$i]        = strtr($line, $this->replace);
    }
    $routine_source = implode("\n", $routine_source);

    // Unset magic constants specific for this stored routine.
    $this->unsetMagicConstants();

    // Drop the stored procedure or function if its exists.
    $this->dropRoutine();

    // Set the SQL-mode under which the stored routine will run.
    MetaDataLayer::setSqlMode($this->sqlMode);

    // Set the default character set and collate under which the store routine will run.
    MetaDataLayer::setCharacterSet($this->characterSet, $this->collate);

    // Finally, execute the SQL code for loading the stored routine.
    MetaDataLayer::loadRoutine($routine_source);
  }
479038
public void loadStaticVariables() {
    auto_metric = this.getBoolean("tsd.core.auto_create_metrics");
    auto_tagk = this.getBoolean("tsd.core.auto_create_tagks");
    auto_tagv = this.getBoolean("tsd.core.auto_create_tagvs");
    enable_compactions = this.getBoolean("tsd.storage.enable_compaction");
    enable_appends = this.getBoolean("tsd.storage.enable_appends");
    repair_appends = this.getBoolean("tsd.storage.repair_appends");
    enable_chunked_requests = this.getBoolean("tsd.http.request.enable_chunked");
    enable_realtime_ts = this.getBoolean("tsd.core.meta.enable_realtime_ts");
    enable_realtime_uid = this.getBoolean("tsd.core.meta.enable_realtime_uid");
    enable_tsuid_incrementing =
      this.getBoolean("tsd.core.meta.enable_tsuid_incrementing");
    enable_tsuid_tracking =
      this.getBoolean("tsd.core.meta.enable_tsuid_tracking");
    if (this.hasProperty("tsd.http.request.max_chunk")) {
      max_chunked_requests = this.getInt("tsd.http.request.max_chunk");
    }
    if (this.hasProperty("tsd.http.header_tag")) {
      http_header_tag = this.getString("tsd.http.header_tag");
    }
    enable_tree_processing = this.getBoolean("tsd.core.tree.enable_processing");
    fix_duplicates = this.getBoolean("tsd.storage.fix_duplicates");
    scanner_max_num_rows = this.getInt("tsd.storage.hbase.scanner.maxNumRows");
    use_otsdb_timestamp = this.getBoolean("tsd.storage.use_otsdb_timestamp");
    get_date_tiered_compaction_start = this.getLong("tsd.storage.get_date_tiered_compaction_start");
    use_max_value = this.getBoolean("tsd.storage.use_max_value");
  }
567406
public function backupRequestVariables()
    {
        $this->requestCache['_SERVER'] = $_SERVER;
        $this->requestCache['_POST'] = $_POST;
        $this->requestCache['_GET'] = $_GET;
        $this->requestCache['_SESSION'] = $_SESSION;
        $this->requestCache['_COOKIE'] = $_COOKIE;
    }
1130580
private function loadAll(): void
  {
    $this->findSourceFiles();
    $this->detectNameConflicts();
    $this->getColumnTypes();
    $this->readStoredRoutineMetadata();
    $this->getConstants();
    $this->getOldStoredRoutinesInfo();
    $this->getCorrectSqlMode();

    $this->loadStoredRoutines();

    // Drop obsolete stored routines.
    $this->dropObsoleteRoutines();

    // Remove metadata of stored routines that have been removed.
    $this->removeObsoleteMetadata();

    $this->io->writeln('');

    // Write the metadata to file.
    $this->writeStoredRoutineMetadata();
  }
1350311
def load_session_from_file(self, username, sessionfile):
        """"""
        session = requests.Session()
        session.cookies = requests.utils.cookiejar_from_dict(pickle.load(sessionfile))
        session.headers.update(self._default_http_header())
        session.headers.update({'X-CSRFToken': session.cookies.get_dict()['csrftoken']})
        self._session = session
        self.username = username
742904
protected void loadConfigs() {
        configs = new Properties();
        // If run as a jar, find in file system classpath first, if not found, then get resource in jar.
        if (ClassPathUtil.testRunMainInJar()) {
            String[] classPathsInFileSystem = ClassPathUtil.getAllClassPathNotInJar();
            String workDir = System.getProperty("user.dir");
            String mainJarRelativePath = ClassPathUtil.getClassPathsInSystemProperty()[0];
            File mainJar = new File(workDir, mainJarRelativePath);
            File mainJarDir = mainJar.getParentFile();
            for (String classPath : classPathsInFileSystem) {
                File classPathFile = new File(classPath);
                File configFile;
                if (classPathFile.isAbsolute()) {
                    configFile = new File(classPathFile, propertiesAbsoluteClassPath);
                } else {
                    configFile = new File(new File(mainJarDir, classPath), propertiesAbsoluteClassPath);
                }
                if (configFile.exists() && configFile.isFile()) {
                    InputStream is = null;
                    try {
                        is = new FileInputStream(configFile);
                        loadConfigsFromStream(is);
                    } catch (FileNotFoundException e) {
                        LOGGER.warn("Load config file " + configFile.getPath() + " error!", e);
                    }
                    return;
                }
            }
        }
        if (propertiesFilePath == null) {
            if (propertiesAbsoluteClassPath == null) {
                return;
            }
            InputStream is = OneProperties.class.getResourceAsStream(propertiesAbsoluteClassPath);
            loadConfigsFromStream(is);
        } else {
            configs = PropertiesIO.load(propertiesFilePath);
        }
    }
1273219
def load_session
      unless logged_in?
        session[Shibbolite.pid] = request.env[Shibbolite.pid.to_s]
        current_user.update(get_attributes) if registered_user?
      end
    end
386765
private function loadConfig() {
    drush_log(dt('Loading config paths.'), 'debug');
    $config_paths = [$this->getSiteDir()];

    // Find directories to scan for environment config files.
    // system, 'home.drush', 'drupal', 'custom'
    foreach ($this->contexts as $context) {
      if ($files = _drush_config_file($context, 'env')) {
        if (is_array($files)) {
          foreach ($files as $file) {
            $config_paths[] = dirname($file);
          }
        }
        else {
          $config_paths[] = dirname($files);
        }
      }
    }

    // Remove any empty values.
    $config_paths = array_filter($config_paths);

    // Flip the config list for proper hierarchy.
    $this->configPaths = array_reverse($config_paths);
    drush_log(dt('Loaded config paths.'), 'debug');
  }
1045417
def system(session, py):
    """"""

    # Sanity check: Only run system tests if the environment variable is set.
    if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''):
        session.skip('Credentials must be set via environment variable.')

    # Run the system tests against latest Python 2 and Python 3 only.
    session.interpreter = 'python{}'.format(py)

    # Set the virtualenv dirname.
    session.virtualenv_dirname = 'sys-' + py

    # Install all test dependencies.
    session.install('-r', 'requirements-test.txt')

    # Install dev packages into the virtualenv's dist-packages.
    _install_dev_packages(session)

    # Run py.test against the system tests.
    session.run(
        'py.test',
        '-s',
        'tests/system/',
        *session.posargs
    )
356991
def init(self, args=None):
        """"""
        from .logs import exception

        self._setup_user_dir()
        self._init_settings_file()

        try:
            self.update(self._settings_from_file())
        except Exception:
            exception("Can't load settings from file", sys.exc_info())

        try:
            self.update(self._settings_from_env())
        except Exception:
            exception("Can't load settings from env", sys.exc_info())

        self.update(self._settings_from_args(args))
1199676
def setup(interactive, not_relative, dry_run, reset, root_dir, testuser):
    """"""

    click.echo("[cellpy] (setup)")

    # generate variables
    init_filename = create_custom_init_filename()
    userdir, dst_file = get_user_dir_and_dst(init_filename)

    if testuser:
        if not root_dir:
            root_dir = os.getcwd()

        click.echo(f"[cellpy] (setup) DEV-MODE testuser: {testuser}")
        init_filename = create_custom_init_filename(testuser)
        userdir = root_dir
        dst_file = get_dst_file(userdir, init_filename)
        click.echo(f"[cellpy] (setup) DEV-MODE userdir: {userdir}")
        click.echo(f"[cellpy] (setup) DEV-MODE dst_file: {dst_file}")

    if not pathlib.Path(dst_file).is_file():
        reset = True

    if interactive:
        click.echo(" interactive mode ".center(80, "-"))
        _update_paths(root_dir, not not_relative, dry_run=dry_run, reset=reset)
        _write_config_file(
            userdir, dst_file,
            init_filename, dry_run,
        )
        _check()

    else:
        _write_config_file(userdir, dst_file, init_filename, dry_run)
        _check()
1215482
def snippets(session):
    """"""

    # Sanity check: Only run snippets tests if the environment variable is set.
    if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
        session.skip("Credentials must be set via environment variable.")

    # Install all test dependencies, then install local packages in place.
    session.install("mock", "pytest")
    for local_dep in LOCAL_DEPS:
        session.install("-e", local_dep)
    session.install("-e", os.path.join("..", "storage"))
    session.install("-e", os.path.join("..", "test_utils"))
    session.install("-e", ".[all]")

    # Run py.test against the snippets tests.
    session.run("py.test", os.path.join("docs", "snippets.py"), *session.posargs)
    session.run("py.test", "samples", *session.posargs)