Gets a path from the workitem number.

        For example: 31942 will return 30000-39999/31000-31999/31900-31999
352638
def get_path(num):
        
        num = int(num)
        dig_len = len(str(num))
        paths = []
        for i in range(dig_len - 2):
            divisor = 10 ** (dig_len - i - 1)
            paths.append(
                "{}-{}".format((num // divisor) * divisor, (((num // divisor) + 1) * divisor) - 1)
            )
        return "/".join(paths)
845560
def data_item_path(cls, project, dataset, data_item):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/datasets/{dataset}/dataItems/{data_item}",
            project=project,
            dataset=dataset,
            data_item=data_item,
        )
956839
def get_item_abspath(self, identifier):
        
        manifest = self.get_manifest()
        item = manifest["items"][identifier]
        item_abspath = os.path.join(self._data_abspath, item["relpath"])
        return item_abspath
67475
def path(self, separator="/"):
        """"""
        rt = ""
        for i in reversed(self):
            rt = "{}{}{}".format(rt, i.name, separator)
        return rt[:-1]
303693
def css_number(self, path, default=NULL, ignore_spaces=False, smart=False,
                   make_int=True):
        

        try:
            text = self.css_text(path, smart=smart)
            return find_number(text, ignore_spaces=ignore_spaces,
                               make_int=make_int)
        except IndexError:
            if default is NULL:
                raise
            else:
                return default
482415
def CollectionItemToAff4Path(item, client_id=None):
  """"""
  if isinstance(item, rdf_flows.GrrMessage):
    client_id = item.source
    item = item.payload
  elif isinstance(item, rdf_flow_objects.FlowResult):
    client_id = item.client_id
    item = item.payload

  if not client_id:
    raise ValueError("Could not determine client_id.")
  elif isinstance(client_id, string_types):
    client_id = rdf_client.ClientURN(client_id)

  if isinstance(item, rdf_client_fs.StatEntry):
    return item.AFF4Path(client_id)
  elif isinstance(item, rdf_file_finder.FileFinderResult):
    return item.stat_entry.AFF4Path(client_id)
  elif isinstance(item, collectors.ArtifactFilesDownloaderResult):
    if item.HasField("downloaded_file"):
      return item.downloaded_file.AFF4Path(client_id)

  raise ItemNotExportableError(item)
1142939
def _get_path(queue_name=None, include_messages=None, message_id=None):
    '''
    
    '''
    if queue_name and include_messages and message_id:
        return '/{0}/messages/{1}'.format(_str(queue_name), message_id)
    if queue_name and include_messages:
        return '/{0}/messages'.format(_str(queue_name))
    elif queue_name:
        return '/{0}'.format(_str(queue_name))
    else:
        return '/'
62515
def get_path(item):
    
    sanitizers = [group_sanitizer, label_sanitizer]
    if isinstance(item, tuple):
        path, item = item
        if item.label:
            if len(path) > 1 and item.label == path[1]:
                path = path[:2]
            else:
                path = path[:1] + (item.label,)
        else:
            path = path[:1]
    else:
        path = (item.group, item.label) if item.label else (item.group,)
    return tuple(capitalize(fn(p)) for (p, fn) in zip(path, sanitizers))
1325017
def get_path(self, i):
        """"""
        index = (i - 1) // 2
        reverse = (i - 1) % 2
        path = self.paths[index]
        if reverse:
            return path.reversed()
        else:
            return path
866240
def path_to_key(filepath):
        """"""
        tmp, last = os.path.split(filepath)
        tmp, middle = os.path.split(tmp)
        return '{}{}{}'.format(os.path.basename(tmp), middle,
                               os.path.splitext(last)[0])
397674
def _get_path(cls, path, depth, newstep):
        
        parentpath = cls._get_basepath(path, depth - 1)
        key = cls._int2str(newstep)
        return '{0}{1}{2}'.format(
            parentpath,
            cls.alphabet[0] * (cls.steplen - len(key)),
            key
        )
472875
def get_path(self, key):
        ""
        if key in self.keys():
            return (key,), self[key]
        else:
            key_path, res = (None, None)
            for sub_key, v in self.items():
                if isinstance(v, self.__class__):
                    key_path, res = v.get_path(key)
                elif hasattr(v, 'get'):
                    res = v.get(key)
                    key_path = (key,) if res is not None else None
                if res is not None and key_path is not None:
                    key_path = (sub_key,) + key_path
                    break
            return key_path, res
245142
protected String checkWorkingFolderInPath( String filePath ) {
        if (filePath.contains(HMConstants.WORKINGFOLDER)) {
            return null;
        }
        return filePath;
    }
730838
def get_path(self, dir=None):
        """"""
        if not dir:
            dir = self.fs.getcwd()
        if self == dir:
            return '.'
        path_elems = self.get_path_elements()
        pathname = ''
        try: i = path_elems.index(dir)
        except ValueError:
            for p in path_elems[:-1]:
                pathname += p.dirname
        else:
            for p in path_elems[i+1:-1]:
                pathname += p.dirname
        return pathname + path_elems[-1].name
817253
def _getitem_via_pathlist(external_dict,path_list,**kwargs):
    '''
        
    '''
    if('s2n' in kwargs):
        s2n = kwargs['s2n']
    else:
        s2n = 0
    if('n2s' in kwargs):
        n2s = kwargs['n2s']
    else:
        n2s = 0
    this = external_dict
    for i in range(0,path_list.__len__()):
        key = path_list[i]
        if(n2s ==1):
            key = str(key)
        if(s2n==1):
            try:
                int(key)
            except:
                pass
            else:
                key = int(key)
        this = this.__getitem__(key)
    return(this)
699734
def getitem_by_path(d, path):
    
    return reduce(
        lambda d, k: d[k],
        path,
        d
    )
981684
def path(self):
        
        return "/".join([
            part
            for part in [
                self.version,
                self.qualifier,
            ]
            if part
        ])