Create a string out of the current file_index
974965
def _get_file_index_str(self):
        """"""
        file_index = str(self.file_index)
        if self.n_digits is not None:
            file_index = file_index.zfill(self.n_digits)
        return file_index
369122
function(fileEntry) {
              var filename = fileObj.fileName.substring(0, fileObj.fileName.lastIndexOf('.'));
              var ext = fileObj.fileName.substring(fileObj.fileName.lastIndexOf('.'));
              var randomStr = randomString(); // if the file with fileName already exists, append the new filename with _randomStr ...
              fileObj.fileName = filename + '_' + randomStr + ext; // ... and file extension
              resolve({root:root, fileObj: fileObj});
            }
1156172
def write_index(fn, index):
    
    with open(fn, "wb") as o_file:
        o_file.write(_CHECK_STRING)
        o_file.write(zlib.compress(bytes(
            index.to_csv(None, index=False, encoding="utf-8"),
            encoding="utf-8",
        )))
1352279
def out_filename(template, n_val, mode):
    """"""
    return '{0}_{1}_{2}.cpp'.format(template.name, n_val, mode.identifier)
1189806
def from_filename(file_name):
    
    base, extension = os.path.splitext(file_name)
    if extension in COMPRESS_EXT:
        # Compressed file
        extension = os.path.splitext(base)[1]
    return from_extension(extension)
822491
def index_file(self, f, overwrite=False):
        
        if isinstance(f, six.string_types):
            f = self.layout.get_file(f)

        if f.path in self.file_index and not overwrite:
            return

        if 'suffix' not in f.entities:  # Skip files without suffixes
            return

        md = self._get_metadata(f.path)

        for md_key, md_val in md.items():
            if md_key not in self.key_index:
                self.key_index[md_key] = {}
            self.key_index[md_key][f.path] = md_val
            self.file_index[f.path][md_key] = md_val
360615
def set_current_filename(self, filename, focus=True):
        """"""
        index = self.has_filename(filename)
        if index is not None:
            if focus:
                self.set_stack_index(index)
            editor = self.data[index].editor
            if focus:
                editor.setFocus()
            else:
                self.stack_history.remove_and_append(index)

            return editor
461547
def _make_index(self, fasta, index):
        
        out = open(index, "wb")
        f = open(fasta)
        # Skip first line of fasta-file
        line = f.readline()
        offset = f.tell()
        line = f.readline()
        while line:
            out.write(pack(self.pack_char, offset))
            offset = f.tell()
            line = f.readline()
        f.close()
        out.close()
209914
def file_or_filename(input):
    
    if isinstance(input, string_types):
        # input was a filename: open as file
        yield smart_open(input)
    else:
        # input already a file-like object; just reset to the beginning
        input.seek(0)
        yield input
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)
455659
def from_filename(self, filename):
        '''
        
        '''
        if os.path.exists(filename):
            with open(filename) as fp:
                return IntentSchema(json.load(fp, object_pairs_hook=OrderedDict))
        else:
            print ('File does not exist')
            return IntentSchema()
1062944
def fromstring(cls, ptb_string, namespace='ptb', precedence=False,
                  ignore_traces=True):
        """"""
        temp = tempfile.NamedTemporaryFile(delete=False)
        temp.write(ptb_string)
        temp.close()
        ptb_docgraph = cls(ptb_filepath=temp.name, namespace=namespace,
                           precedence=precedence, ignore_traces=ignore_traces)
        os.unlink(temp.name)
        return ptb_docgraph
142556
def fromstring(cls, dis_string):
        """"""
        temp = tempfile.NamedTemporaryFile(delete=False)
        temp.write(dis_string)
        temp.close()
        dis_tree = cls(dis_filepath=temp.name)
        os.unlink(temp.name)
        return dis_tree
856769
private static function string()
    {
        $files = ['Strings'];
        $folder = static::$root.'Strings'.'/';

        self::call($files, $folder);

        $files = ['StringOutIndexException'];
        $folder = static::$root.'Strings/Exceptions'.'/';

        self::call($files, $folder);
    }
323282
def __filename(self, id):
        """"""
        suffix = self.fnsuffix()
        filename = "%s-%s.%s" % (self.fnprefix, id, suffix)
        return os.path.join(self.location, filename)
18105
function () {
                    var name, index = i;

                    if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) {
                        return new(tree.Variable)(name, index, env.currentFileInfo);
                    }
                }
1331241
def get_dirname(self, index):
        """"""
        fname = self.get_filename(index)
        if fname:
            if osp.isdir(fname):
                return fname
            else:
                return osp.dirname(fname)