specify a file (or directory containing files) to load system specifications from
503878
def build_crontab_output(opts)
      chdir = Makesure.chdir || File.dirname(Makesure.makesurefile)
      crontab = ""
      crontab << "# Autogenerated by makesure: you probably don't want to edit this file\n\n"
      crontab << "# Cron environment\n"
      crontab << (Makesure.cron_env || "#   customize this by setting Makesure.cron_env in your Makesurefile")
      crontab << "\n"
      Makesure.systems.each do |s|
        uid = s.uid || Makesure.uid
        crontab << "\n"
        crontab << "## Tasks for '#{s.name}'\n"
        crontab << "# Commands\n"
        s.cmds.each do |c|
          crontab << "#{c.cron}\t"
          crontab << "#{uid} " if uid
          crontab << "cd #{chdir} && "

          cmd = "makesure-runner run #{c.command.inspect}"
          crontab << if (opts[:rvm])
            "/bin/bash -l -c '#{cmd}'"
          else
            cmd
          end
          crontab << "\n"
        end

        crontab << "# Verification\n"
        s.verifies.each do |v|
          crontab << "#{v.cron}\t"
          crontab << "#{uid} " if uid
          crontab << "cd #{chdir} && "

          cmd = "makesure-runner verify #{s.name} #{v.name}"
          crontab << if (opts[:rvm])
            "/bin/bash -l -c '#{cmd}'"
          else
            cmd
          end
          crontab << "\n"
        end
        # TODO summarizes
      end
      crontab
    end
1015131
def _load(formula):
    '''
    
    '''

    # Compute possibilities
    _mk_client()
    paths = []
    for ext in ('yaml', 'json'):
        source_url = salt.utils.url.create(formula + '/defaults.' + ext)
        paths.append(source_url)
    # Fetch files from master
    defaults_files = __context__['cp.fileclient'].cache_files(paths)

    for file_ in defaults_files:
        if not file_:
            # Skip empty string returned by cp.fileclient.cache_files.
            continue

        suffix = file_.rsplit('.', 1)[-1]
        if suffix == 'yaml':
            loader = salt.utils.yaml.safe_load
        elif suffix == 'json':
            loader = salt.utils.json.load
        else:
            log.debug("Failed to determine loader for %r", file_)
            continue

        if os.path.exists(file_):
            log.debug("Reading defaults from %r", file_)
            with salt.utils.files.fopen(file_) as fhr:
                defaults = loader(fhr)
                log.debug("Read defaults %r", defaults)

            return defaults or {}
495585
def load_conf(srcdir):
    
    path = os.path.join(srcdir, 'conf.py')
    mylocals = {'__file__': path}
    with open(path) as fd:
        exec(fd.read(), mylocals)
    return mylocals
257232
def load_file(self, filename):
        """"""
        filename = os.path.abspath(filename)

        with open(filename) as f:
            self.load_dict(yaml.load(f))

        self._loaded_files.append(filename)
1318921
def _windowsLdmodSources(target, source, env, for_signature):
    """"""
    return _dllSources(target, source, env, for_signature, 'LDMODULE')
598940
def _load_from_disk(self, dtype_out_time, dtype_out_vert=False,
                        region=False):
        """"""
        ds = xr.open_dataset(self.path_out[dtype_out_time])
        if region:
            arr = ds[region.name]
            # Use region-specific pressure values if available.
            if (self.dtype_in_vert == internal_names.ETA_STR
                    and not dtype_out_vert):
                reg_pfull_str = region.name + '_pressure'
                arr = arr.drop([r for r in arr.coords.iterkeys()
                                if r not in (internal_names.PFULL_STR,
                                             reg_pfull_str)])
                # Rename pfull to pfull_ref always.
                arr = arr.rename({internal_names.PFULL_STR:
                                  internal_names.PFULL_STR + '_ref'})
                # Rename region_pfull to pfull if its there.
                if hasattr(arr, reg_pfull_str):
                    return arr.rename({reg_pfull_str:
                                       internal_names.PFULL_STR})
                return arr
            return arr
        return ds[self.name]
486176
def cli(ctx, directory, uri, verbose, count):
    """"""
    # configure root logger to print to STDERR
    loglevel = "INFO"
    if verbose:
        loglevel = "DEBUG"
    coloredlogs.install(level=loglevel)
    
    p = Path(directory)
    
    if not p.is_dir():
        LOG.warning("{0} is not a valid directory".format(directory))
        ctx.abort()
    
    start_time = datetime.now()
    # Make sure that the database is indexed
    index_call = ['loqusdb', 'index']
    base_call = ['loqusdb']
    if uri:
        base_call.append('--uri')
        base_call.append(uri)
        index_call.append('--uri')
        index_call.append(uri)
    
    subprocess.run(index_call)
    base_call.append('load')
    
    nr_files = 0
    for nr_files,file_name in enumerate(list(p.glob('*.vcf')),1):
        call = deepcopy(base_call)
        case_id = file_name.stem.split('.')[0]
        call.append('--sv-variants')
        call.append(str(file_name))
        call.append('--case-id')
        call.append(case_id)
        if count:
            continue
        try:
            subprocess.run(call, check=True)
        except subprocess.CalledProcessError as err:
            LOG.warning(err)
            LOG.warning("Failed to load file %s", filename)
            LOG.info("Continue with files...")
        
        if nr_files % 100:
            LOG.info("%s files loaded", nr_files)
        
    LOG.info("%s files inserted", nr_files)
    LOG.info("Time to insert files: {}".format(datetime.now()-start_time))
38268
def system_config_dir():
    
    """
    if LINUX or SUNOS:
        path = '/etc'
    elif BSD or MACOS:
        path = '/usr/local/etc'
    else:
        path = os.environ.get('APPDATA')
    if path is None:
        path = ''
    else:
        path = os.path.join(path, 'glances')

    return path
493179
def load(file_or_path):
    
    # This is the pickling pain when changing _src -> src
    import sys
    import inspect
    sys.modules['GPy.kern._src'] = kern.src
    for name, module in inspect.getmembers(kern.src):
        if not name.startswith('_'):
            sys.modules['GPy.kern._src.{}'.format(name)] = module
    sys.modules['GPy.inference.optimization'] = inference.optimization
    import paramz
    return paramz.load(file_or_path)
139391
def requirements(filename):
    """"""
    with open(filename) as f:
        return [x.strip() for x in f.readlines() if x.strip()]
747388
def parse_reqs(filename):
    """"""
    install_reqs = parse_requirements(filename, session=False)
    return [str(ir.req) for ir in install_reqs]
172695
def load(self, **kwargs):
        """"""

        coordsys = kwargs.get('coordsys', 'CEL')
        extdir = kwargs.get('extdir', self.extdir)
        srcname = kwargs.get('srcname', None)

        self.clear()
        self.load_diffuse_srcs()

        for c in self.config['catalogs']:

            if isinstance(c, catalog.Catalog):
                self.load_existing_catalog(c)
                continue

            extname = os.path.splitext(c)[1]
            if extname != '.xml':
                self.load_fits_catalog(c, extdir=extdir, coordsys=coordsys,
                                       srcname=srcname)
            elif extname == '.xml':
                self.load_xml(c, extdir=extdir, coordsys=coordsys)
            else:
                raise Exception('Unrecognized catalog file extension: %s' % c)

        for c in self.config['sources']:

            if 'name' not in c:
                raise Exception(
                    'No name field in source dictionary:\n ' + str(c))

            self.create_source(c['name'], c, build_index=False)

        self._build_src_index()
283593
function load(filename, envs) {
    const config = {};
    if (!path.isAbsolute(filename)) {
        filename = path.resolve(process.cwd(), filename);
    }
    if (fs.existsSync(filename)) {
        const stat = fs.lstatSync(filename);
        if (stat.isFile()) {
            if (/.json$/.test(filename)) {
                const content = fs.readFileSync(filename, 'utf8');
                Object.assign(config, fn.resolve(JSON.parse(content), envs));
            }
        } else if (stat.isDirectory()) {
            const files = fs
                .readdirSync(filename)
                .filter(
                    f =>
                        fs.lstatSync(path.resolve(filename, f)).isFile() &&
                        /.json$/.test(f)
                );
            files.forEach(file => {
                const content = fs.readFileSync(
                    path.resolve(filename, file),
                    'utf8'
                );
                const basename = path.basename(file, path.extname(file));
                Object.assign(config, {
                    [basename]: fn.resolve(JSON.parse(content), envs)
                });
            });
        }
    }

    return config;
}
638952
def load(self, _from):
        """"""

        def load_rec(inode, config):
            """Recursive part of loading."""
            for k in config:
                if isinstance(config[k], dict) and \
                   k not in ['value', 'default']:
                    if k in inode:
                        load_rec(inode[k], config[k])
                    else:
                        LOG.debug("+ config element: '%s'", k)
                else:
                    inode[k] = config[k]

        with open(_from, 'r') as infile:
            obj = yaml.load(infile, Loader=ConfigLoader)
            upgrade(obj)
            load_rec(self.node, obj)
            self['config_file'] = os.path.abspath(_from)
298612
def get_file_content(url, comes_from=None):
    """"""
    match = _scheme_re.search(url)
    if match:
        scheme = match.group(1).lower()
        if (scheme == 'file' and comes_from
            and comes_from.startswith('http')):
            raise InstallationError(
                'Requirements file %s references URL %s, which is local'
                % (comes_from, url))
        if scheme == 'file':
            path = url.split(':', 1)[1]
            path = path.replace('\\', '/')
            match = _url_slash_drive_re.match(path)
            if match:
                path = match.group(1) + ':' + path.split('|', 1)[1]
            path = urllib.unquote(path)
            if path.startswith('/'):
                path = '/' + path.lstrip('/')
            url = path
        else:
            ## FIXME: catch some errors
            resp = urlopen(url)
            return geturl(resp), resp.read()
    try:
        f = open(url)
        content = f.read()
    except IOError:
        e = sys.exc_info()[1]
        raise InstallationError('Could not open requirements file: %s' % str(e))
    else:
        f.close()
    return url, content
848906
def load_files(files):
    """"""

    for py_file in files:
        LOG.debug("exec %s", py_file)
        execfile(py_file, globals(), locals())
201955
def load(cls, filename, encoding):
        """"""
        if encoding is None:
            encoding = cls.encoding

        with io.open(filename, 'r', encoding=encoding) as fd:
            source = fd.read()

        if cls.normalize_newlines:
            source = source.replace('\r\n', '\n').replace('\r', '\n')
        return cls.loads(source)