Creates a absolute path in the file system.

    :param path: The path to be created
496381
def create_path(path):
    
    import os
    if not os.path.exists(path):
        os.makedirs(path)
227613
def extend_path():
    
    if ROOT not in sys.path:
        sys.path.insert(0, ROOT)

    if LIB not in sys.path:
        sys.path.insert(0, LIB)
410190
def copy_file(self, path):
        
        if "*" in path:
            paths = _expand_paths(path)
            if paths:
                for path in paths:
                    self._copy_file(path)
        else:
            if os.path.isfile(path):
                return self._copy_file(path)
            else:
                logger.debug("File %s does not exist", path)
                return False
248910
def create_dir_rec(path: Path):
    
    if not path.exists():
        Path.mkdir(path, parents=True, exist_ok=True)
1229810
def absolute_path(self, path, minify=True):
        '''
        '''
        if minify:
            ending = '.%s' % self.mediatype
            if not path.endswith(ending):
                if self.minified:
                    path = '%s.min' % path
                path = '%s%s' % (path, ending)
        #
        if self.is_relative(path) and self.media_path:
            return '%s%s' % (self.media_path, path)
        elif self.asset_protocol and path.startswith('//'):
            return '%s%s' % (self.asset_protocol, path)
        else:
            return path
571704
def makedirs(self, path):
        
        root = ""

        assert path.startswith('/')
        p = path.strip('/')
        for item in p.split('/'):
            root += "/" + item
            if not self.exists(root):
                self.makedir(root)

        return self.find(path)
856373
def absSymPath(path):
    
    curr_path = os.getcwd()
    return os.path.normpath(os.path.join(curr_path, path))
932291
def _makedirs(path):
    
    dirname, _ = os.path.split(path)
    try:
        os.makedirs(dirname)
    except OSError as exc:
        if exc.errno == errno.EEXIST:
            pass
        else:
            raise
227962
def to_absolute_paths(paths):
    
    abspath = os.path.abspath
    paths = return_set(paths)
    absolute_paths = {abspath(x) for x in paths}
    return absolute_paths
877838
def return_abs_path(directory, path):
    
    if directory is None or path is None:
        return
    directory = os.path.expanduser(directory)
    return os.path.abspath(os.path.join(directory, path))
549430
def make_path_relative(path):
    
    if os.path.isabs(path):
        drive_s,path = os.path.splitdrive(path)

        import re
        if not drive_s:
            path=re.compile("/*(.*)").findall(path)[0]
        else:
            path=path[1:]

    assert( not os.path.isabs( path ) ), path
    return path
31858
def absolute_path(user_path):
    
    if os.path.abspath(user_path):
        return unix_path_coercion(user_path)
    else:
        try:
            openaccess_epub.utils.evaluate_relative_path(relative=user_path)
        except:
            raise ValidationError('This path could not be rendered as absolute')
1305053
def createpath(path, mode, exists_ok=True):
    
    try:
        os.makedirs(path, mode)
    except OSError, e:
        if e.errno != errno.EEXIST or not exists_ok:
            raise e
705955
def add_path(self, path):
        

        if os.path.exists(path):
            self.paths.add(path)
            return path
        else:
            #logger.debug('Path {} doesn\'t exist'.format(path))
            return None
313434
def abspath(myPath):
    import sys, os
    
    try:
        # PyInstaller creates a temp folder and stores path in _MEIPASS
        base_path = sys._MEIPASS
        return os.path.join(base_path, os.path.basename(myPath))
    except Exception:
        base_path = os.path.abspath(os.path.dirname(__file__))
        return os.path.join(base_path, myPath)
1319371
def check_path(path, create=False):
    
    if not os.path.exists(path):
        if create:
            os.makedirs(path)
            return os.path.exists(path)
        else:
            return False

    return True
324822
def register_path(self, path):
        
        self._paths.insert(0, os.path.abspath(path))