Join input path to sample data path (usually in ~/lisa_data)

    :param path_to_join: one or more paths
    :param get_root: return dataset root path. If false, the path would be into "medical/orig"
    :return: joined path
506869
def join_path(*path_to_join, **kwargs):
    
    if "get_root" in kwargs:
        get_root = kwargs["get_root"]
    else:
        # default value
        get_root = False
    sdp = dataset_path(get_root=get_root)
    pth = os.path.join(sdp, *path_to_join)
    logger.debug("sample_data_path" + str(sdp))
    logger.debug("path " + str(pth))
    return pth
1030530
def join_paths(path1: Optional[str], path2: Optional[str]) -> Optional[str]:
    
    if path1 is not None and path2 is not None:
        return os.path.join(path1, path2)
91665
def sample_path(self, seed):
        
        branchset = self.root_branchset
        branch_ids = []
        while branchset is not None:
            [branch] = sample(branchset.branches, 1, seed)
            branch_ids.append(branch.branch_id)
            branchset = branch.child_branchset
        modelname = self.root_branchset.get_branch_by_id(branch_ids[0]).value
        return modelname, branch_ids
549195
def GetRootFileEntry(self):
    
    path_spec = data_range_path_spec.DataRangePathSpec(
        range_offset=self._range_offset,
        range_size=self._range_size,
        parent=self._path_spec.parent)
    return self.GetFileEntryByPathSpec(path_spec)
801379
def join_path(self, *path):
		
		path = self.directory_sep().join(path)
		return self.normalize_path(path)
257210
def safe_join(base, *paths):
    
    base = base
    paths = [p for p in paths]
    final_path = abspath(os.path.join(base, *paths))
    base_path = abspath(base)
    base_path_len = len(base_path)

    # Ensure final_path starts with base_path (using normcase to ensure we
    # don't false-negative on case insensitive operating systems like Windows)
    # and that the next character after the final path is os.sep (or nothing,
    # in which case final_path must be equal to base_path).
    if not os.path.normcase(final_path).startswith(os.path.normcase(base_path)) \
       or final_path[base_path_len:base_path_len + 1] not in ("", os.path.sep):
        raise ValueError("The joined path (%s) is located outside of the base "
                         "path component (%s)" % (final_path, base_path))
    return final_path
12166
def GetDataByPath(self, path):
    
    _, path_data = self._paths.get(path, (None, None))
    return path_data
411852
def join_cwd(self, path=None):
        

        if self.working_dir:
            logger.debug(
                "'%s' instance 'working_dir' set to '%s' for join_cwd",
                type(self).__name__, self.working_dir,
            )
            cwd = self.working_dir
        else:
            cwd = getcwd()
            logger.debug(
                "'%s' instance 'working_dir' unset; "
                "default to process '%s' for join_cwd",
                type(self).__name__, cwd,
            )

        if path:
            return join(cwd, path)
        return cwd
895949
def join_path(fname:PathOrStr, path:PathOrStr='.')->Path:
    ""
    return Path(path)/Path(fname)
475440
def get_paths(rlz):
    
    dic = {}
    if hasattr(rlz, 'sm_lt_path'):  # composite realization
        dic['source_model_tree_path'] = '_'.join(rlz.sm_lt_path)
        dic['gsim_tree_path'] = '_'.join(rlz.gsim_lt_path)
    else:  # simple GSIM realization
        dic['source_model_tree_path'] = ''
        dic['gsim_tree_path'] = '_'.join(rlz.lt_path)
    return dic
619544
def example_path(cls, project, dataset, annotated_dataset, example):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}",
            project=project,
            dataset=dataset,
            annotated_dataset=annotated_dataset,
            example=example,
        )
333224
def path_to_geom_dicts(path, skip_invalid=True):
    
    interface = path.interface.datatype
    if interface == 'geodataframe':
        return [row.to_dict() for _, row in path.data.iterrows()]
    elif interface == 'geom_dictionary':
        return path.data

    geoms = []
    invalid = False
    xdim, ydim = path.kdims
    for i, path in enumerate(path.split(datatype='columns')):
        array = np.column_stack([path.pop(xdim.name), path.pop(ydim.name)])
        splits = np.where(np.isnan(array[:, :2].astype('float')).sum(axis=1))[0]
        arrays = np.split(array, splits+1) if len(splits) else [array]
        subpaths = []
        for j, arr in enumerate(arrays):
            if j != (len(arrays)-1):
                arr = arr[:-1] # Drop nan

            if len(arr) == 0:
                continue
            elif len(arr) == 1:
                if skip_invalid:
                    continue
                g = Point(arr[0])
                invalid = True
            else:
                g = LineString(arr)
            subpaths.append(g)

        if invalid:
            geoms += [dict(path, geometry=sp) for sp in subpaths]
            continue
        elif len(subpaths) == 1:
            geom = subpaths[0]
        elif subpaths:
            geom = MultiLineString(subpaths)
        path['geometry'] = geom
        geoms.append(path)
    return geoms
1343983
def get_relative_path(self, root):
        
        if self.path == root:
            return ''
        ancestors = self.ancestors(stop=root)
        return functools.reduce(lambda f, p: Folder(p.name).child(f),
                                ancestors,
                                self.name)
394019
def local_path(path):
    
    current = os.path.dirname(__file__)
    root = current
    return os.path.abspath(os.path.join(root, path))
1009309
def url2tmp(self, root, url):
        
        filename = url.rsplit('/', 1)[-1]
        return os.path.join(root, filename)
761322
def get_dataset_path(*args):
    
    d = os.environ.get('TENSORPACK_DATASET', None)
    if d is None:
        d = os.path.join(os.path.expanduser('~'), 'tensorpack_data')
        if execute_only_once():
            logger.warn("Env var $TENSORPACK_DATASET not set, using {} for datasets.".format(d))
        if not os.path.isdir(d):
            mkdir_p(d)
            logger.info("Created the directory {}.".format(d))
    assert os.path.isdir(d), d
    return os.path.join(d, *args)
93183
def get_data_path(cls):
        
        marvin_path = os.environ.get(cls._key)
        if not marvin_path:
            raise InvalidConfigException('Data path not set!')

        is_path_created = check_path(marvin_path, create=True)
        if not is_path_created:
            raise InvalidConfigException('Data path does not exist!')

        return marvin_path