Find the extension number of the give extname and extver.
773775
def findExtNum(self, extname=None, extver=1):
        """"""
        extnum = None
        extname = extname.upper()

        if not self._isSimpleFits:
            for ext in self._image:
                if (hasattr(ext,'_extension') and 'IMAGE' in ext._extension and
                    (ext.extname == extname) and (ext.extver == extver)):
                    extnum = ext.extnum
        else:
            log.info("Image is simple fits")

        return extnum
407983
def extension(filename):
    ''''''
    filename = os.path.basename(filename)
    extension = None

    while '.' in filename:
        filename, ext = os.path.splitext(filename)
        if ext.startswith('.'):
            ext = ext[1:]
        extension = ext if not extension else ext + '.' + extension

    return extension
885037
public function getExtension()
    {
        $basename = $this->getBasename();
        if (false !== $pos = strrpos($basename, '.')) {
            $ext = substr($basename, $pos + 1);
        } else {
            $ext = '';
        }
        return $ext;
    }
693168
def _get_ex_data(self):
        """"""
        func_id, func_name = self._get_callable_path()
        if self._full_cname:
            func_name = self.encode_call(func_name)
        return func_id, func_name
161370
def get_file_extension(format_):
    """"""
    if format_ not in FORMAT_IDENTIFIER_TO_FORMAT_CLASS:
        raise UnknownFormatIdentifierError(format_)

    for ext, f in FILE_EXTENSION_TO_FORMAT_IDENTIFIER.items():
        if f == format_:
            return ext

    raise RuntimeError("No file extension for format %r" % format_)
442008
function getExtension(file) {
        var ret;
        if (file) {
            var fileTypes = file.split('.');
            var len = fileTypes.length;
            if (0 === len) {
                return ret;
            }
            ret = fileTypes[len - 1];
            return ret;
        }
    }
1118832
def match_extension(f):
    ''''''
    (root,ext) = os.path.splitext(f)
    return ext.lower() in extensions
488260
def get_extension(self, protocol):
        
        if protocol not in self.registry:
            raise NoProtocolError("No protocol for %s" % protocol)
        index = self.registry[protocol]
        return self.extensions[index]
717241
private function determineExtension()
    {
        $ext = 'php';
        if (in_array($this->driverClass, $this->extensionToDriver)) {
            $map = array_flip($this->extensionToDriver);
            $ext = $map[$this->driverClass];
        }
        return $ext;
    }
911650
public Extension getExtension(String name) {
        if (name != null) {
            for (int i = 0; i < extensionList.size(); i++) {
                Extension p = getExtension(i);
                if (p.getName().equalsIgnoreCase(name)) {
                    return p;
                }
            }
        }
        
        return null;
    }
742908
def check_extensions(extensions: Set[str], allow_multifile: bool = False):
    
    check_var(extensions, var_types=set, var_name='extensions')

    # -- check them one by one
    for ext in extensions:
        check_extension(ext, allow_multifile=allow_multifile)
1129311
def get_ext_name(names_key, id_key)
      return nil unless ext_data[id_key] > 0

      res = Phonelib.phone_ext_data[names_key][ext_data[id_key]]
      return nil unless res
      res.size == 1 ? res.first : res
    end
339577
def ext_from_filename(filename):
    
    try:
        base, ext = filename.lower().rsplit(".", 1)
    except ValueError:
        return ''
    ext = ".{0}".format(ext)
    all_exts = [x.extension for x in chain(magic_header_array,
                                           magic_footer_array)]

    if base[-4:].startswith("."):
        # For double extensions like like .tar.gz
        long_ext = base[-4:] + ext
        if long_ext in all_exts:
            return long_ext
    return ext
598422
def get_filename_and_extension_of(target_file):
    
    base_target_filename = os.path.basename(target_file)
    file_name, file_ext_with_dot = os.path.splitext(base_target_filename)
    return file_name, file_ext_with_dot
895204
def get_filename(self, runSetName, fileExtension):
        '''
        
        '''

        fileName = self.benchmark.output_base_name + ".results."

        if runSetName:
            fileName += runSetName + "."

        return fileName + fileExtension
320391
def get_extname(self):
        
        name = self._info['extname']
        if name.strip() == '':
            name = self._info['hduname']
        return name.strip()
610466
def _findExtnames(self, extname=None, exclude=None):
        
        #make a list of the available extension names for the object
        extensions=[]
        if extname is not None:
            if not isinstance(extname,list): extname=[extname]
            for extn in extname:
                extensions.append(extn.upper())
        else:
        #restore all the extensions data from the original file, be careful here
        #if you've altered data in memory you want to keep!
            for i in range(1,self._nextend+1,1):
                if hasattr(self._image[i],'_extension') and \
                    "IMAGE" in self._image[i]._extension:
                    if self._image[i].extname.upper() not in extensions:
                        extensions.append(self._image[i].extname)
        #remove this extension from the list
        if exclude is not None:
            exclude.upper()
            if exclude in extensions:
                newExt=[]
                for item in extensions:
                    if item != exclude:
                        newExt.append(item)
            extensions=newExt
            del newExt
        return extensions