returns the name of the source archive file, if any
430142
def src_archive
      from_directory do
        Find.find(File.join("packages", name)) do |file|
          if File.file?(file) && file.match(/\.(spec)|(sh)|(patch)$/).nil?
            return File.basename(file)
          end
        end
        nil
      end
    end
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)
923934
def in_download_archive(track):
    
    global arguments
    if not arguments['--download-archive']:
        return

    archive_filename = arguments.get('--download-archive')
    try:
        with open(archive_filename, 'a+', encoding='utf-8') as file:
            logger.debug('Contents of {0}:'.format(archive_filename))
            file.seek(0)
            track_id = '{0}'.format(track['id'])
            for line in file:
                logger.debug('"'+line.strip()+'"')
                if line.strip() == track_id:
                    return True
    except IOError as ioe:
        logger.error('Error trying to read download archive...')
        logger.debug(ioe)

    return False
1331241
def get_dirname(self, index):
        """"""
        fname = self.get_filename(index)
        if fname:
            if osp.isdir(fname):
                return fname
            else:
                return osp.dirname(fname)
162948
def artifact_filename(self):
    
    def maybe_compenent(component):
      return '-{}'.format(component) if component else ''

    return '{org}-{name}{rev}{classifier}.{ext}'.format(org=self.org,
                                                        name=self.name,
                                                        rev=maybe_compenent(self.rev),
                                                        classifier=maybe_compenent(self.classifier),
                                                        ext=self.ext)
1196030
def getFileName(self, suffix=None, extension="jar"):
        

        assert (self._artifactId is not None)
        assert (self._version is not None)

        return "{0}-{1}{2}{3}".format(
            self._artifactId,
            self._version.getRawString(),
            "-" + suffix.lstrip("-") if suffix is not None else "",
            "." + extension.lstrip(".") if extension is not None else ""
        )
1059942
public static String getFileName(final ConfigurationSourceKey source){
		//ensure an exception is thrown if we are not file.
		if (source.getType()!=ConfigurationSourceKey.Type.FILE)
			throw new AssertionError("Can only load configuration sources with type "+ConfigurationSourceKey.Type.FILE);
		return source.getName()+ '.' +source.getFormat().getExtension();
	}
1088991
def getinputfilename(self, inputtemplate, filename):
        
        if inputtemplate.filename:
            filename = inputtemplate.filename
        elif inputtemplate.extension:
            if filename.lower()[-4:] == '.zip' or filename.lower()[-7:] == '.tar.gz' or filename.lower()[-8:] == '.tar.bz2':
                #pass archives as-is
                return filename

            if filename[-len(inputtemplate.extension) - 1:].lower() != '.' +  inputtemplate.extension.lower():
                filename += '.' + inputtemplate.extension

        return filename
746890
def filename(self):
        
        filename = self.key

        if self.has_revision_file() and self.history.current_revision:
            filename += "-"
            filename += self.history.current_revision.revision_id

        filename += ".zip"

        return filename
1290188
def extract_archive(archive, verbosity=0, outdir=None, program=None, interactive=True):
    """"""
    util.check_existing_filename(archive)
    if verbosity >= 0:
        util.log_info("Extracting %s ..." % archive)
    return _extract_archive(archive, verbosity=verbosity, interactive=interactive, outdir=outdir, program=program)
565876
@Nullable
  public String getSourceFileName() {
    StaticSourceFile file = getStaticSourceFile();
    return file == null ? null : file.getName();
  }
1196223
def _archive_cls(file, ext=''):
        
        cls = None
        filename = None
        if is_string(file):
            filename = file
        else:
            try:
                filename = file.name
            except AttributeError:
                raise UnrecognizedArchiveFormat(
                    "File object not a recognized archive format.")
        lookup_filename = filename + ext
        base, tail_ext = os.path.splitext(lookup_filename.lower())
        cls = extension_map.get(tail_ext)
        if not cls:
            base, ext = os.path.splitext(base)
            cls = extension_map.get(ext)
        if not cls:
            raise UnrecognizedArchiveFormat(
                "Path not a recognized archive format: %s" % filename)
        return cls
1024632
function getFullFilename(filename) {
  if (p.isAbsolute(filename)) {
    return filename
  }
  return p.join(process.cwd(), filename)
}
1104766
def _create_cache_filename(self, source_file):
        
        res = self._create_cache_key(source_file) + ".cache"
        return os.path.join(self.__dir, res)
765943
@Override
    public Path getFileName() {
        // Root and empty String has no file name
        if (path.length() == 0 || path.equals(ArchivePaths.root().get())) {
            return null;
        } else {
            final List<String> tokens = tokenize(this);
            // Furthest out
            final Path fileName = new ShrinkWrapPath(tokens.get(tokens.size() - 1), this.fileSystem);
            return fileName;
        }
    }
1127900
def is_archive_file(name):
    # type: (str) -> bool
    """"""
    ext = splitext(name)[1].lower()
    if ext in ARCHIVE_EXTENSIONS:
        return True
    return False
80716
def guess_archive_type(name):
    '''
    
    '''
    name = name.lower()
    for ending in ('tar', 'tar.gz', 'tgz',
                   'tar.bz2', 'tbz2', 'tbz',
                   'tar.xz', 'txz',
                   'tar.lzma', 'tlz'):
        if name.endswith('.' + ending):
            return 'tar'
    for ending in ('zip', 'rar'):
        if name.endswith('.' + ending):
            return ending
    return None