Take from environment variable, create dirs and
        create file if doesn' exist.
491200
def _set_local_file_path(self):
        

        self.FILE_LOCAL = self._transfer.get_env('FILE_LOCAL')

        if not self.FILE_LOCAL:
            filename = '{}_{}.{}'.format(str(self._transfer.prefix),
                                         str(self._transfer.namespace),
                                         str(self.file_extension))
            self.FILE_LOCAL = os.path.join(os.path.expanduser("~"), filename)

        dirs = os.path.dirname(self.FILE_LOCAL)
        if not os.path.exists(dirs):
            os.makedirs(dirs)

        try:
            open(self.FILE_LOCAL, "rb+").close()
        except:
            open(self.FILE_LOCAL, "a").close()
1187667
def _ensure_directory(path):
    """"""
    dirname = os.path.dirname(path)
    if not os.path.isdir(dirname):
        os.makedirs(dirname)
570607
def _make_sure_dir_exists(self):
        
        filename = self.model_config.checkpoint_dir()
        pathlib.Path(filename).mkdir(parents=True, exist_ok=True)
248080
def makedir(path):
    
    if path is not None and not os.path.exists(path):
        os.makedirs(path)
177671
def ensure_directory(path):
    """"""
    dirname = os.path.dirname(path)
    py31compat.makedirs(dirname, exist_ok=True)
566648
def mkdir_p(path):
    """"""

    try:
        os.makedirs(path)
    except EnvironmentError as exc:
        if exc.errno != errno.EEXIST:
            raise
573988
def ensure_dir_exists(verify_dir):
    """"""
    if not os.path.exists(verify_dir):
        # Doesn't exist create dir
        os.makedirs(verify_dir)
    else:
        # Exists
        if not os.path.isdir(verify_dir):
            # Not a dir, raise an exception
            raise ValueError("{} is not a directory".format(verify_dir))
505945
def ensure_dirs(filename):
    """"""
    dirname, _ = os.path.split(filename)
    if dirname and not os.path.exists(dirname):
        os.makedirs(dirname)
535084
def ensure_dirs(filename):
    """"""
    dirname = os.path.dirname(filename)
    if dirname and not os.path.exists(dirname):
        os.makedirs(dirname)
1316270
def makedirs(name, mode=0o777, exist_ok=False):
    

    if os.path.exists(name):
        if not exist_ok:
            raise FileExistsError("File exists: " + name)
    else:
        os.makedirs(name, mode)
8311
def ensure_directory(path):
    
    dirname = os.path.dirname(path)
    if not os.path.exists(dirname):
        os.makedirs(dirname)
959427
def render_and_create_dir(dirname, context, output_dir, environment,
                          overwrite_if_exists=False):
    """"""
    name_tmpl = environment.from_string(dirname)
    rendered_dirname = name_tmpl.render(**context)

    dir_to_create = os.path.normpath(
        os.path.join(output_dir, rendered_dirname)
    )

    logger.debug('Rendered dir {} must exist in output_dir {}'.format(
        dir_to_create,
        output_dir
    ))

    output_dir_exists = os.path.exists(dir_to_create)

    if output_dir_exists:
        if overwrite_if_exists:
            logger.debug(
                'Output directory {} already exists,'
                'overwriting it'.format(dir_to_create)
            )
        else:
            msg = 'Error: "{}" directory already exists'.format(dir_to_create)
            raise OutputDirExistsException(msg)
    else:
        make_sure_path_exists(dir_to_create)

    return dir_to_create, not output_dir_exists
317354
def ensure_dir_does_not_exist(*args):
    """"""
    path = os.path.join(*args)
    if os.path.isdir(path):
        shutil.rmtree(path)
1347215
def ensure_parent_dir_exists(file_path):
    """"""
    parent = os.path.dirname(file_path)
    if parent:
        os.makedirs(parent, exist_ok=True)
746408
def create_dir(directory):
    
    if not os.access(directory, os.F_OK):
        os.makedirs(directory)
    return os.path.abspath(directory)
899941
def make(self):
        
        try:
            if not self.exists:
                logger.info("Creating %s" % self.path)
                os.makedirs(self.path)
        except os.error:
            pass
        return self
1058573
def ensure_dir(directory: str) -> None:
    """"""
    if not os.path.isdir(directory):
        LOG.debug(f"Directory {directory} does not exist, creating it.")
        os.makedirs(directory)