List of pairs (split, paths) for the current epoch.
543036
def splits_and_paths(self, data_dir):
    """"""
    filepath_fns = {
        problem.DatasetSplit.TRAIN: self.training_filepaths,
        problem.DatasetSplit.EVAL: self.dev_filepaths,
        problem.DatasetSplit.TEST: self.test_filepaths,
    }

    def append_epoch(paths):
      return [
          "{}.{}".format(path, self.current_epoch)
          for path in paths
      ]

    # We set shuffled=True as we don't want to shuffle on disk later.
    return [
        (split["split"], append_epoch(filepath_fns[split["split"]](
            data_dir, split["shards"], shuffled=True
        )))
        for split in self.dataset_splits
    ]
94934
def paired_paths(main_path, fmt, formats):
    """"""
    if not formats:
        return [(main_path, {'extension': os.path.splitext(main_path)[1]})]

    formats = long_form_multiple_formats(formats)

    # Is there a format that matches the main path?
    base = base_path(main_path, fmt)
    paths = [full_path(base, fmt) for fmt in formats]

    if main_path not in paths:
        raise InconsistentPath(u"Paired paths '{}' do not include the current notebook path '{}'. "
                               u"Current format is '{}', and paired formats are '{}'."
                               .format("','".join(paths), main_path, short_form_one_format(fmt),
                                       short_form_multiple_formats(formats)))

    if len(paths) > len(set(paths)):
        raise InconsistentPath(u'Duplicate paired paths for this notebook. Please fix jupytext.formats.')

    return list(zip(paths, formats))
657210
def get_pythonpath(self, at_start=False):
        """"""
        if at_start:
            current_path = self.get_option('current_project_path',
                                           default=None)
        else:
            current_path = self.get_active_project_path()
        if current_path is None:
            return []
        else:
            return [current_path]
1073351
def slices(src_path):
  '''  '''
  pages = list_slices(src_path)
  slices = []
  for page in pages:
    slices.extend(page.slices)
  return slices
793067
def split_path_info(self, path_info: str) -> Tuple[str, str]:
        
        return path_info[:self.matchlength], path_info[self.matchlength:]
292503
def _find_common_roots(paths):
    """"""
    paths = [x.split(os.path.sep) for x in paths]
    root = {}
    for chunks in sorted(paths, key=len, reverse=True):
        node = root
        for chunk in chunks:
            node = node.setdefault(chunk, {})
        node.clear()

    rv = set()

    def _walk(node, path):
        for prefix, child in iteritems(node):
            _walk(child, path + (prefix,))
        if not node:
            rv.add("/".join(path))

    _walk(root, ())
    return rv
1138902
def _get_verts_and_connect(self, paths):
        
        verts = np.vstack(paths)
        gaps = np.add.accumulate(np.array([len(x) for x in paths])) - 1
        connect = np.ones(gaps[-1], dtype=bool)
        connect[gaps[:-1]] = False
        return verts, connect
1235509
def _steps_to_slices():
    """"""
    if not (conf.core.timesteps or conf.core.snapshots):
        # default to the last snap
        conf.core.timesteps = None
        conf.core.snapshots = slice(-1, None, None)
        return
    elif conf.core.snapshots:
        # snapshots take precedence over timesteps
        # if both are defined
        conf.core.timesteps = None
        steps = conf.core.snapshots
    else:
        conf.core.snapshots = None
        steps = conf.core.timesteps
    steps = steps.split(':')
    steps[0] = int(steps[0]) if steps[0] else None
    if len(steps) == 1:
        steps.append(steps[0] + 1)
    steps[1] = int(steps[1]) if steps[1] else None
    if len(steps) != 3:
        steps = steps[0:2] + [1]
    steps[2] = int(steps[2]) if steps[2] else None
    steps = slice(*steps)
    if conf.core.snapshots is not None:
        conf.core.snapshots = steps
    else:
        conf.core.timesteps = steps
214502
def path_join(*args):
    """"""
    return SEP.join((x for x in args if x not in (None, ''))).strip(SEP)
432184
def join(*paths):
	
	"""
	paths_with_drives = map(os.path.splitdrive, paths)
	drives, paths = zip(*paths_with_drives)
	# the drive we care about is the last one in the list
	drive = next(filter(None, reversed(drives)), '')
	return os.path.join(drive, os.path.join(*paths))
1289339
def join_paths(fnames:FilePathList, path:PathOrStr='.')->Collection[Path]:
    ""
    path = Path(path)
    return [join_path(o,path) for o in fnames]
1260411
def _slice_split_info_to_instruction_dicts(self, list_sliced_split_info):
    """"""
    instruction_dicts = []
    for sliced_split_info in list_sliced_split_info:
      mask = splits_lib.slice_to_percent_mask(sliced_split_info.slice_value)

      # Compute filenames from the given split
      filepaths = list(sorted(self._build_split_filenames(
          split_info_list=[sliced_split_info.split_info],
      )))

      # Compute the offsets
      if sliced_split_info.split_info.num_examples:
        shard_id2num_examples = splits_lib.get_shard_id2num_examples(
            sliced_split_info.split_info.num_shards,
            sliced_split_info.split_info.num_examples,
        )
        mask_offsets = splits_lib.compute_mask_offsets(shard_id2num_examples)
      else:
        logging.warning(
            "Statistics not present in the dataset. TFDS is not able to load "
            "the total number of examples, so using the subsplit API may not "
            "provide precise subsplits."
        )
        mask_offsets = [0] * len(filepaths)

      for filepath, mask_offset in zip(filepaths, mask_offsets):
        instruction_dicts.append({
            "filepath": filepath,
            "mask": mask,
            "mask_offset": mask_offset,
        })
    return instruction_dicts
497743
def pairs(a):
    
    a = np.asarray(a)
    return as_strided(a, shape=(a.size - 1, 2), strides=a.strides * 2)
404786
def response_path_as_list(path: ResponsePath) -> List[Union[str, int]]:
    
    flattened: List[Union[str, int]] = []
    append = flattened.append
    curr: Optional[ResponsePath] = path
    while curr:
        append(curr.key)
        curr = curr.prev
    return flattened[::-1]
83591
def gradient_list(start, end, steps):
    """"""
    delta = [end[i] - start[i] for i in range(4)]
    return [bytearray(start[j] + (delta[j] * i) // steps for j in range(4))
            for i in range(steps + 1)]
1023470
def _get_result_paths(self,data):
        
        result = {}
        result['Tree'] = ResultPath(Path=splitext(self._input_filename)[0] + \
                                                  '.tree')
        return result
1071717
def os_path_split_asunder(path, debug=False):
        
        parts = []
        while True:
            newpath, tail = os.path.split(path)
            if debug: print repr(path), (newpath, tail)
            if newpath == path:
                assert not tail
                if path: parts.append(path)
                break
            parts.append(tail)
            path = newpath
        parts.reverse()
        return parts