Create path to lock file with given name as base.
        
        :param str lock_name_base: Lock file name, designed to not be prefixed 
            with the lock file designation, but that's permitted.
        :return str: Path to the lock file.
771717
def _make_lock_path(self, lock_name_base):
        

        # For lock prefix validation, separate file name from other path
        # components, as we care about the name prefix not path prefix.
        base, name = os.path.split(lock_name_base)

        lock_name = self._ensure_lock_prefix(name)
        if base:
            lock_name = os.path.join(base, lock_name)
        return pipeline_filepath(self, filename=lock_name)
580115
def _compute_path(self, name):
        
        path = self._normalize_path(os.path.join(self.base_directory, name))
        if not path.startswith(self.base_directory):
            raise FileNotWithinStorageError(name)
        return path
231034
def basename(path, ext=""):
    """"""
    import os.path
    if ext is False:
        return os.path.basename(path).replace(extname(path), "")
    else:
        return os.path.basename(path).replace(ext, "")
203460
def create_filebase_name(self, group_info, extension='gz', file_name=None):
        
        dirname = self.filebase.formatted_dirname(groups=group_info)
        if not file_name:
            file_name = self.filebase.prefix_template + '.' + extension
        return dirname, file_name
1167205
public static String basename(String path)
  {
    return path != null ? basename(new File(path)) : null;
  }
311676
def _lock(self, url: str, name: str, hash_: str):
        
        self._new_lock.append({
            'url': url,
            'name': name,
            'hash': hash_,
        })
        self._stale_files.pop(name, None)
1303422
def getConstraint(self, name):
        
        return lock_and_call(
            lambda: Constraint(self._impl.getConstraint(name)),
            self._lock
        )
453687
def _basename(fname):
    """"""
    if not isinstance(fname, Path):
        fname = Path(fname)
    path, name, ext = fname.parent, fname.stem, fname.suffix
    return path, name, ext
1142012
def base_warfare(name, bases, attributes):
    

    assert len(bases) == 1, "{0} | '{1}' object has multiple bases!".format(__name__, name)

    base = foundations.common.get_first_item(bases)
    for name, value in attributes.iteritems():
        if name != "__metaclass__":
            setattr(base, name, value)
    return base
411068
def make_tmp_name(name):
    
    path, base = os.path.split(name)
    tmp_base = ".tmp-%s-%s" % (base, uuid4().hex)
    tmp_name = os.path.join(path, tmp_base)

    try:
        yield tmp_name
    finally:
        safe_remove(tmp_name)
1161197
def create_repo(self, name):
        

        name = os.path.abspath(name)
        logger.debug("create_repo %s", name)

        self.safe_mkdir(name)

        udir = os.path.join(name, '_upkg')
        self.safe_mkdir(udir)

        ctx = {
            'pkg_name': os.path.basename(name),
        }

        for t in TMPLS:
            self.mk_tmpl(
                os.path.join(udir, t['name']),
                t['tmpl'],
                ctx,
                t.get('mode')
            )
974048
def build_base_filename(self):
        
        if self.stream:
            self.stream.close()
            self.stream = None

        # remove old suffix
        if self.suffix_time != "":
            index = self.baseFilename.find("." + self.suffix_time)
            if index == -1:
                index = self.baseFilename.rfind(".")
            self.baseFilename = self.baseFilename[:index]

        # add new suffix
        current_time_tuple = time.localtime()
        self.suffix_time = time.strftime(self.suffix, current_time_tuple)
        self.baseFilename = self.baseFilename + "." + self.suffix_time

        self.mode = 'a'
        if not self.delay:
            self.stream = self._open()
239969
def acquire_lock(path: str, blocking: bool) -> Generator[Optional[int], None, None]:
    """"""
    try:
        with open(path, "w+") as lockfile:
            if not blocking:
                lock_command = fcntl.LOCK_EX | fcntl.LOCK_NB
            else:
                lock_command = fcntl.LOCK_EX

            fcntl.lockf(lockfile.fileno(), lock_command)
            yield lockfile.fileno()
            fcntl.lockf(lockfile.fileno(), fcntl.LOCK_UN)

    except FileNotFoundError:
        yield
397358
def name(self):
    """"""
    # Note that the root file entry is virtual and has no
    # cpio_archive_file_entry.
    if self._cpio_archive_file_entry is None:
      return ''

    return self._file_system.BasenamePath(self._cpio_archive_file_entry.path)
614608
def basename(path):
    """"""
    base_path = path.strip(SEP)
    sep_ind = base_path.rfind(SEP)
    if sep_ind < 0:
        return path

    return base_path[sep_ind + 1:]
748212
def lock_pid(self):
        
        
        if os.path.exists(self.lock_filename):
            return int(open(self.lock_filename).read())
        else:
            return None
343057
function basename(file){
    var extname = path.extname(file);
    return path.basename(file, extname);
}