return the app key that will open this mime type
492891
def getDefaultApplicationForMimeType(self, pchMimeType, pchAppKeyBuffer, unAppKeyBufferLen):
        """"""

        fn = self.function_table.getDefaultApplicationForMimeType
        result = fn(pchMimeType, pchAppKeyBuffer, unAppKeyBufferLen)
        return result
1035406
def app_public_key(self, id, **kwargs):
        ""
        api_path = "/api/v2/apps/{id}/public_key.pem"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
270926
def guess_mime_type(self, path):
		
		_, ext = posixpath.splitext(path)
		if ext in self.extensions_map:
			return self.extensions_map[ext]
		ext = ext.lower()
		return self.extensions_map[ext if ext in self.extensions_map else '']
904835
def mime(self):
        '''
        
        '''
        return self.metadata['ContentType'] if 'ContentType' in self.metadata else BaseEngine.get_mimetype(self.buffer)
843614
def getApplicationKeyByIndex(self, unApplicationIndex, pchAppKeyBuffer, unAppKeyBufferLen):
        

        fn = self.function_table.getApplicationKeyByIndex
        result = fn(unApplicationIndex, pchAppKeyBuffer, unAppKeyBufferLen)
        return result
360908
def guess_mimetype (filename, read=None):
    """"""
    mime, encoding = None, None
    if mimedb:
        mime, encoding = mimedb.guess_type(filename, strict=False)
    basename = os.path.basename(filename)
    # Special case for Safari Bookmark files
    if not mime and basename == 'Bookmarks.plist':
        return 'application/x-plist+safari'
    # Special case for Google Chrome Bookmark files.
    if not mime and basename == 'Bookmarks':
        mime = 'text/plain'
    # Some mime types can be differentiated further with content reading.
    if mime in ("text/plain", "application/xml", "text/xml") and read is not None:
        read_mime = guess_mimetype_read(read)
        if read_mime is not None:
            mime = read_mime
    if not mime:
        mime = "application/octet-stream"
    elif ";" in mime:
        # split off not needed extension info
        mime = mime.split(';')[0]
    return mime.strip().lower()
453450
def get_open(self, appid):
        
        return self._post(
            'cgi-bin/open/get',
            data={
                'appid': appid,
            },
            result_processor=lambda x: x['open_appid'],
        )
752126
def guess_mimetype_read(read):
    """"""
    mime = None
    try:
        data = read()[:70]
    except Exception:
        pass
    else:
        for cmime, ro in PARSE_CONTENTS.items():
            if ro.search(data):
                mime = cmime
                break
    return mime
100425
public static function getKey(): string
    {
        $key = static::getConfig('application')->get('key');

        if ($key === null || $key === '') {
            throw new ApplicationException('The key \'key\' in application config is invalid; please set non-empty string there');
        }

        if ($key == '_____ENTERSomeRandomKeyHere_____') {
            throw new ApplicationException('Please configure key \'key\' in main application config, it can\'t be _____ENTERSomeRandomKeyHere_____');
        }

        if (strlen($key) > 32) {
            throw new ApplicationException('Please make sure your application key in application config is not longer then 32 chars');
        }

        return $key;
    }
279993
def image_opener(key):
    
    if hasattr(g, 'obj'):
        obj = g.obj
    else:
        obj = protect_api(key)

    fp = obj.file.storage().open('rb')

    # If ImageMagick with Wand is installed, extract first page
    # for PDF/text.
    if HAS_IMAGEMAGICK and obj.mimetype in ['application/pdf', 'text/plain']:
        first_page = Image(Image(fp).sequence[0])
        tempfile_ = tempfile.TemporaryFile()
        with first_page.convert(format='png') as converted:
            converted.save(file=tempfile_)
        return tempfile_
    return fp
670032
def get_key(key=None, keyfile=None):
    
    if key is None:
        if keyfile is None:
            key = environ.get('CRYPTOYAML_SECRET')
            if key is None:
                raise MissingKeyException(
                    '''You must either provide a key value,'''
                    ''' a path to a key or its value via the environment variable '''
                    ''' CRYPTOYAML_SECRET'''
                )
            else:
                key = key.encode('utf-8')
        else:
            key = open(keyfile, 'rb').read()
    return key
814579
def mime_type(self):
        
        guesses = None
        if self.path:
            guesses = guess_type(self.path)
        return guesses and guesses[0] or self.DEFAULT_MIME_TYPE
1359898
def _get_app(self, appname):
        
        try:
            app = APPS.get_app_config(appname)
        except Exception as e:
            self.err(e)
            return
        return app
187033
def get_urlfield_cache_key(model, pk, language_code=None):
    
    return 'anyurlfield.{0}.{1}.{2}.{3}'.format(model._meta.app_label, model.__name__, pk, language_code or get_language())
875789
def getkey(stype, site_id=None, key=None):
	''
	base = '{0}.feedjack'.format(settings.CACHE_MIDDLEWARE_KEY_PREFIX)
	if stype == T_HOST: return '{0}.hostcache'.format(base)
	elif stype == T_ITEM: return '{0}.{1}.item.{2}'.format(base, site_id, str2md5(key))
	elif stype == T_META: return '{0}.{1}.meta'.format(base, site_id)
	elif stype == T_INTERVAL: return '{0}.interval.{1}'.format(base, str2md5(key))
95314
def guess_mimetype(filename):
    
    m, encoding = mimetypes.guess_type(filename)
    if encoding:
        m = ENCODING_MIMETYPES.get(encoding, None)
    return m or 'application/octet-stream'
451572
def key(self, att=None):
        """"""
        if att is not None:
            return self._key[self.id][att]
        else:
            return self._key[self.id]