Ensure that this path's *parent* directory exists.

        Returns a boolean whether the parent directory was created. Will
        attempt to create superior parent directories if *parents* is true.
340788
def ensure_parent (self, mode=0o777, parents=False):
        
        return self.parent.ensure_dir (mode, parents)
127784
protected boolean checkParentDirs(String path, boolean createIfAbsent) throws IOException {
      String[] components = Util.components(path, SEPARATOR);
      if (components == null)
         return false;
      if (components.length == 1) // no parent directories to create, e.g. "data.txt"
         return true;

      StringBuilder sb = new StringBuilder();
      boolean first = true;

      for (int i = 0; i < components.length - 1; i++) {
         String tmp = components[i];
         if (!tmp.equals(SEPARATOR)) {
            if (first)
               first = false;
            else
               sb.append(SEPARATOR);
         }
         sb.append(tmp);
         String comp = sb.toString();
         if (comp.equals(SEPARATOR))
            continue;
         Metadata val = exists(comp);
         if (val != null) {
            if (val.isFile())
               throw new IOException(format("cannot create %s as component %s is a file", path, comp));
         } else if (createIfAbsent) {
            metadataCache.put(comp, new Metadata(0, System.currentTimeMillis(), chunkSize, Metadata.DIR));
         } else {
            // Couldn't find a component and we're not allowed to create components!
            return false;
         }

      }
      // check that we have found all the components we need.
      return true;
   }
33568
def ensure_dir_exists(path):
    """"""

    import os

    f_dir = os.path.dirname(path)

    if not os.path.exists(f_dir):
        os.makedirs(f_dir)

    return f_dir
49785
def _IsDirectory(parent, item):
  """"""
  return tf.io.gfile.isdir(os.path.join(parent, item))
1262796
def ensure_dir_exists(path):
    
    dir_path = os.path.dirname(path)
    if not os.path.exists(dir_path):
        os.makedirs(dir_path)
343385
def is_subdirectory(potential_subdirectory, expected_parent_directory):
        

        def _get_normalized_parts(path):
            return DKCloudCommandRunner.os_path_split_asunder(os.path.realpath(os.path.abspath(os.path.normpath(path))))

        # make absolute and handle symbolic links, split into components
        sub_parts = _get_normalized_parts(potential_subdirectory)
        parent_parts = _get_normalized_parts(expected_parent_directory)

        if len(parent_parts) > len(sub_parts):
            # a parent directory never has more path segments than its child
            return False

        # we expect the zip to end with the short path, which we know to be the parent
        return all(part1 == part2 for part1, part2 in zip(sub_parts, parent_parts))
85329
def has_directory(self, name: str):
        '''
        
        '''
        return os.path.isdir(self._path / name)
893730
def parent_folder(path, base=None):
    
    return path and os.path.dirname(resolved_path(path, base=base))
87495
public static boolean isUnderDirectory(File child, File parent) {
        if (child == null || parent == null)
            return false;

        URI childUri = child.toURI();
        URI relativeUri = parent.toURI().relativize(childUri);
        return relativeUri.equals(childUri) ? false : true;

    }
676053
def get_parent_dir(name):
    """"""
    parent_dir = os.path.dirname(os.path.dirname(name))
    if parent_dir:
        return parent_dir
    return os.path.abspath('.')
1350690
def select_from(self, parent_path):
        """"""
        path_cls = type(parent_path)
        is_dir = path_cls.is_dir
        exists = path_cls.exists
        listdir = parent_path._accessor.listdir
        return self._select_from(parent_path, is_dir, exists, listdir)
1310944
def _ensure_tree(path):
    
    try:
        os.makedirs(path)
    except OSError as e:
        if e.errno == errno.EEXIST:
            if not os.path.isdir(path):
                raise
            else:
                return False
        elif e.errno == errno.EISDIR:
            return False
        else:
            raise
    else:
        return True
183567
def check_create_folder(folder_path):
    
    if not os.path.exists(folder_path):
        os.makedirs(folder_path)

    return folder_path
801730
def ensure_dir_exists(directory):
    """"""
    if directory and not os.path.exists(directory):
        os.makedirs(directory)
629102
def exists(self):
        
        if self.name in ("", "/") and self.parent is None:
            return True
        else:
            return self in self.parent.directories
258197
def is_dir_exists(dirpath):
        # type: (AnyStr) -> bool
        """"""
        if dirpath is None or not os.path.exists(dirpath) or not os.path.isdir(dirpath):
            return False
        else:
            return True
430705
def ensure_dir_exists(cls, filepath):
        
        directory = os.path.dirname(filepath)
        if directory != '' and not os.path.exists(directory):
            try:
                os.makedirs(directory)
            except OSError as e:
                if e.errno != errno.EEXIST:
                    raise