Decode a cached fileName back to a job store file ID.

        :param str cachedFilePath: Path to the cached file
        :return: The jobstore file ID associated with the file
        :rtype: str
187740
def decodedFileID(self, cachedFilePath):
        
        fileDir, fileName = os.path.split(cachedFilePath)
        assert fileDir == self.localCacheDir, 'Can\'t decode uncached file names'
        # We encode and decode here because base64 can't work with unencoded text
        # Its probably worth, later, converting all file name variables to bytes
        # and not text.
        return base64.urlsafe_b64decode(fileName.encode('utf-8')).decode('utf-8')
631210
def _get_default_cache_dir(self):
        

        return os.path.join(os.path.dirname(__file__), self._DATA_DIR)
220634
@Nonnull
    public static String getFileName(@Nonnull String filePath) {
        int idx = filePath.lastIndexOf('\\');
        if(idx>=0)
            return getFileName(filePath.substring(idx+1));
        idx = filePath.lastIndexOf('/');
        if(idx>=0)
            return getFileName(filePath.substring(idx+1));
        return filePath;
    }
100304
def cache_local_file(self, path, **kwargs):
        '''
        
        '''
        dest = os.path.join(self.opts['cachedir'], 'localfiles',
                            path.lstrip('/'))
        destdir = os.path.dirname(dest)

        if not os.path.isdir(destdir):
            os.makedirs(destdir)

        shutil.copyfile(path, dest)
        return dest
1164933
def get(self, path):
        
        assert isinstance(path, mitogen.core.UnicodeType)
        self._lock.acquire()
        try:
            if path in self._cache:
                return self._cache[path]
            latch = mitogen.core.Latch()
            waiters = self._waiters.setdefault(path, [])
            waiters.append(lambda: latch.put(None))
        finally:
            self._lock.release()

        LOG.debug('%r.get(%r) waiting for uncached file to arrive', self, path)
        latch.get()
        LOG.debug('%r.get(%r) -> %r', self, path, self._cache[path])
        return self._cache[path]
643447
def toil_get_file(file_store, index, existing, file_store_id):
    """"""

    if not file_store_id.startswith("toilfs:"):
        return file_store.jobStore.getPublicUrl(file_store.jobStore.importFile(file_store_id))
    src_path = file_store.readGlobalFile(file_store_id[7:])
    index[src_path] = file_store_id
    existing[file_store_id] = src_path
    return schema_salad.ref_resolver.file_uri(src_path)
883911
def tryload_cache(dpath, fname, cfgstr, verbose=None):
    
    try:
        return load_cache(dpath, fname, cfgstr, verbose=verbose)
    except IOError:
        return None
1349779
def get_file(self, file_path):
    

    try:
      resp = self._conn.get_object(
        Bucket=self._path.bucket,
        Key=self.get_path_to_file(file_path),
      )

      encoding = ''
      if 'ContentEncoding' in resp:
        encoding = resp['ContentEncoding']

      return resp['Body'].read(), encoding
    except botocore.exceptions.ClientError as err: 
      if err.response['Error']['Code'] == 'NoSuchKey':
        return None, None
      else:
        raise
820130
def get_cached_item(self, path):
        
        item_path = '%s/%s' % (
                self.cache_folder,
                path.strip('/')
            )

        try:
            f = tempfile.NamedTemporaryFile()
            self.blob_service.get_blob_to_path(self.container_name, item_path, f.name)
            f.seek(0)
            image = Image.open(f.name)
            f.close()

            return image
        except AzureMissingResourceHttpError:
            return False
654747
def CacheFileObject(self, path_spec, file_object):
    
    self._file_object_cache.CacheObject(path_spec.comparable, file_object)
255317
def get_fpath(self, cachedir=None, cfgstr=None, ext=None):
        
        _dpath = self.get_cachedir(cachedir)
        _fname = self.get_prefix()
        _cfgstr = self.get_cfgstr() if cfgstr is None else cfgstr
        _ext =   self.ext if ext is None else ext
        fpath = _args2_fpath(_dpath, _fname, _cfgstr, _ext)
        return fpath
168067
def find_file_ident_desc_by_name(self, currpath):
        # type: (bytes) -> UDFFileIdentifierDescriptor
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF File Entry not initialized')

        # If this is a directory or it is an empty directory, just skip
        # all work.
        if self.icb_tag.file_type != 4 or not self.fi_descs:
            raise pycdlibexception.PyCdlibInvalidInput('Could not find path')

        tmp = currpath.decode('utf-8')
        try:
            latin1_currpath = tmp.encode('latin-1')
        except (UnicodeDecodeError, UnicodeEncodeError):
            latin1_currpath = b''
        ucs2_currpath = tmp.encode('utf-16_be')

        child = None

        for fi_desc in self.fi_descs:
            if latin1_currpath and fi_desc.encoding == 'latin-1':
                eq = fi_desc.fi == latin1_currpath
            else:
                eq = fi_desc.fi == ucs2_currpath

            if eq:
                child = fi_desc
                break

        if child is None:
            raise pycdlibexception.PyCdlibInvalidInput('Could not find path')

        return child
71478
private String resolveFileStorePath(String fileStorePath) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, "resolveFileStorePath", new Object[] { fileStorePath });
        }

        String filePath = null;

        try {
            BundleContext bundleContext = FrameworkUtil.getBundle(
                                                                  WsLocationAdmin.class).getBundleContext();
            ServiceReference<WsLocationAdmin> locationAdminRef = bundleContext
                            .getServiceReference(WsLocationAdmin.class);
            WsLocationAdmin locationAdmin = bundleContext
                            .getService(locationAdminRef);
            filePath = locationAdmin.resolveString(fileStorePath);
        } catch (Exception e) {
            SibTr.exception(tc, e);
            FFDCFilter.processException(e, this.getClass().getName(), "720", this);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, "resolveFileStorePath", new Object[] { filePath });
        }
        return filePath;

    }
900637
def get_file_content(self, path):
        
        id = self._get_id_for_path(path)
        blob = self.repository._repo[id]
        return blob.as_pretty_string()
12824
def decode_file_name(aFilename)
      prefix,date,ext = aFilename.scan(/(.*?)\-(.*?)\.(.*)/).flatten
      return Time.from_date_numeric(date)
    end
1141463
def cache_to_df(dir_path):
    
    table = {}
    for attrib in glob.glob(os.path.join(dir_path, '*')):
        attrib_name, attrib_ext = os.path.splitext(os.path.basename(attrib))
        if attrib_ext == '.lf8':
            attrib_data = np.fromfile(attrib, np.float64)
            table[attrib_name] = attrib_data

        elif attrib_ext == '.lf4':
            attrib_data = np.fromfile(attrib, np.float32)
            table[attrib_name] = attrib_data

        elif attrib_ext == '.li2':
            attrib_data = np.fromfile(attrib, np.int16)
            table[attrib_name] = attrib_data

        elif attrib_ext == '.li4':
            attrib_data = np.fromfile(attrib, np.int32)
            table[attrib_name] = attrib_data

        elif attrib_ext == '.li8':
            attrib_data = np.fromfile(attrib, np.int64)
            table[attrib_name] = attrib_data

        elif attrib_ext == '.ib1':
            attrib_data = np.fromfile(attrib, np.bool_)
            table[attrib_name] = attrib_data

        elif attrib_ext.startswith('.iS'):
            length_string = int(attrib_ext[3:])
            attrib_data = np.fromfile(attrib, ('a' + str(length_string)))
            table[attrib_name] = attrib_data

        else:
            print('Array {} is not a recognized data type'.format(attrib))

    df = pd.DataFrame(table)
    return df
673360
def GetFileSystem(self, path_spec):
    
    identifier = self._GetFileSystemCacheIdentifier(path_spec)
    return self._file_system_cache.GetObject(identifier)