Compose data runtime location path.
504548
def get_runtime_path(self, filename=None):
        """"""
        return self.get_path(prefix=settings.FLOW_EXECUTOR['RUNTIME_DIR'], filename=filename)
451382
protected Map<String, Location> loadPaths(Scriptable cfg) throws URISyntaxException {
		Object pathlocs = cfg.get(PATHS_CONFIGPARAM, cfg);
		Map<String, Location> paths = new HashMap<String, Location>();
		if (pathlocs instanceof Scriptable) {
			for (Object key : ((Scriptable)pathlocs).getIds()) {
				String name = toString(key);

				if (!paths.containsKey(name) && key instanceof String) {
					Location location = loadLocation(((Scriptable)pathlocs).get(name, (Scriptable)pathlocs), false);
					paths.put(name, getBase().resolve(location));
				}
			}
		}
		return paths;
	}
701393
def prepare_runtime(self, runtime_dir, data):
        """"""
        # Copy over Python process runtime (resolwe.process).
        import resolwe.process as runtime_package

        src_dir = os.path.dirname(inspect.getsourcefile(runtime_package))
        dest_package_dir = os.path.join(runtime_dir, PYTHON_RUNTIME_DIRNAME, 'resolwe', 'process')
        shutil.copytree(src_dir, dest_package_dir)
        os.chmod(dest_package_dir, 0o755)

        # Write python source file.
        source = data.process.run.get('program', '')
        program_path = os.path.join(runtime_dir, PYTHON_PROGRAM_FILENAME)
        with open(program_path, 'w') as file:
            file.write(source)
        os.chmod(program_path, 0o755)

        # Write serialized inputs.
        inputs = copy.deepcopy(data.input)
        hydrate_input_references(inputs, data.process.input_schema)
        hydrate_input_uploads(inputs, data.process.input_schema)
        inputs_path = os.path.join(runtime_dir, PYTHON_INPUTS_FILENAME)

        # XXX: Skip serialization of LazyStorageJSON. We should support
        # LazyStorageJSON in Python processes on the new communication protocol
        def default(obj):
            """Get default value."""
            class_name = obj.__class__.__name__
            if class_name == 'LazyStorageJSON':
                return ''

            raise TypeError(f'Object of type {class_name} is not JSON serializable')

        with open(inputs_path, 'w') as file:
            json.dump(inputs, file, default=default)

        # Generate volume maps required to expose needed files.
        volume_maps = {
            PYTHON_RUNTIME_DIRNAME: PYTHON_RUNTIME_VOLUME,
            PYTHON_PROGRAM_FILENAME: PYTHON_PROGRAM_VOLUME,
            PYTHON_INPUTS_FILENAME: PYTHON_INPUTS_VOLUME,
        }

        return volume_maps
206339
def appdata_roaming_dir():
    """"""
    install = arcpy.GetInstallInfo('desktop')
    app_data = arcpy.GetSystemEnvironment("APPDATA")
    product_dir = ''.join((install['ProductName'], major_version()))
    return os.path.join(app_data, 'ESRI', product_dir)
687885
def registry_path(cls, project, location, registry):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/locations/{location}/registries/{registry}",
            project=project,
            location=location,
            registry=registry,
        )
1321387
def get_program_path():
    """"""

    src_folder = os.path.dirname(__file__)
    program_path = os.sep.join(src_folder.split(os.sep)[:-1]) + os.sep

    return program_path
1067456
def irods_filepath(det_id, run_id):
    """"""
    data_path = "/in2p3/km3net/data/raw/sea"
    from km3pipe.db import DBManager
    if not isinstance(det_id, int):
        dts = DBManager().detectors
        det_id = int(dts[dts.OID == det_id].SERIALNUMBER.values[0])
    return data_path + "/KM3NeT_{0:08}/{2}/KM3NeT_{0:08}_{1:08}.root" \
           .format(det_id, run_id, run_id//1000)
1086031
function(compose, project, run, opts) {

    // Get our compose files and build the pre opts
    var cmd = parseComposeOptions(compose, project, opts).concat([run]);

    // Get options
    cmd = cmd.concat(parseOptions(opts));

    // Add in a services arg if its there
    if (opts && opts.services) {
      _.forEach(opts.services, function(service) {
        cmd.push(service);
      });
    }

    // Add in a command arg if its there
    if (opts && opts.cmd) {
      if (typeof opts.cmd === 'string') {
        opts.cmd = [opts.cmd];
      }
      if (_.isArray(opts.entrypoint)) {
        cmd.push(kbox.util.shell.escSpaces(opts.cmd.join(' ')));
      }
      else {
        cmd = _.flatten(cmd.concat(opts.cmd));
      }
    }

    return cmd;

  }
53631
def _create_paths(self, basedir, name=None):
        """"""
        if name:
            datapath = os.path.join(basedir, name)
        else:
            datapath = basedir

        dbpath = os.path.join(datapath, 'db')
        if not os.path.exists(dbpath):
            os.makedirs(dbpath)
        if self.args['verbose']:
            print('creating directory: %s' % dbpath)

        return datapath
366666
def _runtime(self, project, base):
        ''' 
        '''
        def run(path_suf):
            path = '{}/{}'.format(base, path_suf)
            err = 'error sourcing {}.vim: {{}}'.format(path)
            return (
                self.vim.runtime(path)
                .cata(L(err.format)(_) >> List, lambda a: List())
            )
        return (
            project.all_types.flat_map(run) +
            (project.tpe.map(_ + '/' + project.name).map(run) | List()) +
            run('all/*')
        ).map(Error)
699443
def location_for(self, path):
        """"""
        path = path.split('.')
        node = self
        while node._parent:
            node = node._parent
        location = node.location
        for name in path:
            tree = node._tree.get(name, None)
            if tree is None or type(tree) is float:
                return location
            location = tree.location
        return location
306842
def database_path(cls, project, instance, database):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/instances/{instance}/databases/{database}",
            project=project,
            instance=instance,
            database=database,
        )
806177
def database_root_path(cls, project, database):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/databases/{database}",
            project=project,
            database=database,
        )
1070116
def prepare(base_path='data',
            serialize=json.dumps,
            deserialize=json.loads,
            file_ext='json'):
    """"""
    global _basepath, _deserialize, _serialize, _ext
    _basepath = base_path
    assert callable(serialize)
    assert callable(deserialize)
    _serialize = serialize
    _deserialize = deserialize
    _ext = file_ext
    _logger.debug('preparing with base path %s and file ext %s',
        _basepath, _ext)
    assert len(_db)
    for collection in _db.keys():
        c_path = collection_path(collection)
        os.makedirs(c_path, exist_ok=True)
        _logger.info('collection "%s": %d objects',
            collection, object_count(collection))
130255
def _get_result_paths(self, data):
        """"""
        result = {}
        result['FASTA'] = ResultPath(Path=self._get_seqs_outfile())
        result['CLSTR'] = ResultPath(Path=self._get_clstr_outfile())
        return result
1213816
def package_data_location():
    '''

    '''
    pkg_dir = os.path.split(__file__)[0]
    pkg_data_dir = os.path.join(pkg_dir,'data')
    return pkg_data_dir
199517
def scan_run_path(cls, project, scan_config, scan_run):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}",
            project=project,
            scan_config=scan_config,
            scan_run=scan_run,
        )