Returns the filename of the target RST file, relative to a specified
        index file. Used to make the index refer to the RST.
497687
def rst_filename_rel_autodoc_index(self, index_filename: str) -> str:
        
        index_dir = dirname(abspath(expanduser(index_filename)))
        return relpath(self.target_rst_filename, start=index_dir)
597255
public String getFileName(String originalFileName) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_targetFileName)) {
            return m_targetFileName;
        } else if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_targetFileNamePrefix)) {
            return m_targetFileNamePrefix + originalFileName;
        } else {
            return originalFileName;
        }
    }
1312362
def view_meta_index():
    
    rst_files = [filename[2:-4] for filename in sorted(glob.glob("./*.rst"))]
    rst_files.reverse()
    return template('index',
                    type="view",
                    filelist=rst_files,
                    name="__index__",
                    extended_name=None,
                    history=[],
                    gitref=None,
                    is_repo=check_repo())
649001
def read_file(name):
    """"""
    cur_path = os.path.dirname(__file__)
    exts = ('txt', 'rst')
    for ext in exts:
        path = os.path.join(cur_path, '.'.join((name, ext)))
        if os.path.exists(path):
            with open(path, 'rt') as file_obj:
                return file_obj.read()

    return ''
306817
def write_index_and_rst_files(self, overwrite: bool = False,
                                  mock: bool = False) -> None:
        
        for f in self.files_to_index:
            if isinstance(f, FileToAutodocument):
                f.write_rst(
                    prefix=self.rst_prefix,
                    suffix=self.rst_suffix,
                    heading_underline_char=self.source_rst_heading_underline_char,  # noqa
                    overwrite=overwrite,
                    mock=mock,
                )
            elif isinstance(f, AutodocIndex):
                f.write_index_and_rst_files(overwrite=overwrite, mock=mock)
            else:
                fail("Unknown thing in files_to_index: {!r}".format(f))
        self.write_index(overwrite=overwrite, mock=mock)
591627
private int parseFileIndex(String fileName) {
    Matcher match = null;
    String indexString = null;
    try {
      match = exportPattern.matcher(fileName);
      match.find();
      indexString = match.group(1);
    } catch (Exception e) {
      throw new IllegalStateException(String.format("Failed to parse file '%s'", fileName), e);
    }
    long longValue = Long.parseLong(indexString);
    if (longValue > Integer.MAX_VALUE) {
      throw new IndexOutOfBoundsException(String.format(
          "Invalid fileName '%s'; max allowable index is %d, got %d instead",
          fileName, Integer.MAX_VALUE, longValue));
    }
    return (int) longValue;
  }
4659
private void updateIndexTermTargetName() {
        if (defaultTitle == null) {
            defaultTitle = targetFile;
        }
        for (final IndexTerm indexterm : indexTermList) {
            updateIndexTermTargetName(indexterm);
        }
    }
834638
def rpc_get_names(self, filename, source, offset):
        
        source = get_source(source)
        if hasattr(self.backend, "rpc_get_names"):
            return self.backend.rpc_get_names(filename, source, offset)
        else:
            raise Fault("get_names not implemented by current backend",
                        code=400)
1115213
public static final String getIndexFileName() {
        Configuration config = ConfigUtils.getCurrentConfig();
        if (config != null) {
            return config.getString(INDEX_FILE_NAME_CONFIG_KEY, DEFAULT_INDEX_FILE_NAME);
        } else {
            return DEFAULT_INDEX_FILE_NAME;
        }
    }
628764
public static String getFileExt(String fileName) {
        int dotPos = fileName.lastIndexOf('.');
        if (dotPos != -1 && dotPos != fileName.length() - 1) {
            return fileName.substring(dotPos);
        } else {
            return null;
        }
    }
1106319
def get_file_name(query):
	
	match = re.search(r'\S*\.[\d\w]{1,4}', query)
	if(match):
		filename = match.group()
		return filename
	else:
		start = match.start()
		end = match.end()
		spaces = re.finditer(r' ', query)
		space_index = []
		for space in spaces:
			space_index.append(space.start())
		space_index.pop()
		for i in space_index:
			filename = query[i+1:end]
			if(os.path.isfile(filename)):
				return filename
		return None
1022382
def get_filename(file):
    
    if not os.path.exists(file):
        return None
    return "%s%s" % os.path.splitext(file)
839916
def parse_rst_index(rstpth):
    

    pthidx = {}
    pthlst = []
    with open(rstpth) as fd:
        lines = fd.readlines()
    for i, l in enumerate(lines):
        if i > 0:
            if re.match(r'^  \w+', l) is not None and \
               re.match(r'^\w+', lines[i - 1]) is not None:
                # List of subdirectories in order of appearance in index.rst
                pthlst.append(lines[i - 1][:-1])
                # Dict mapping subdirectory name to description
                pthidx[lines[i - 1][:-1]] = l[2:-1]
    return pthlst, pthidx
611352
def filename(self):
        """"""
        if self.value and 'value' in self._json_data and self._json_data['value']:
            return self._json_data['value'].split('/')[-1]
        return None
963602
protected String getName(final String relative) {
        return relative.substring(relative.lastIndexOf(File.separator) + 1);
    }
1172626
def _GetRelPath(self, filename):
		""""""
		assert filename.startswith(self.subdir), (filename, self.subdir)
		return filename[len(self.subdir):].lstrip(r"\/")
393610
def filePath(self, index):
        
        return self._fs_model_source.filePath(
            self._fs_model_proxy.mapToSource(index))