Determine auth location for filename, like 'bugzillacookies'. If
    old style ~/.bugzillacookies exists, we use that, otherwise we
    use ~/.cache/python-bugzilla/bugzillacookies. Same for bugzillatoken
192454
def _default_auth_location(filename):
    
    homepath = os.path.expanduser("~/.%s" % filename)
    xdgpath = os.path.expanduser("~/.cache/python-bugzilla/%s" % filename)
    if os.path.exists(xdgpath):
        return xdgpath
    if os.path.exists(homepath):
        return homepath

    if not os.path.exists(os.path.dirname(xdgpath)):
        os.makedirs(os.path.dirname(xdgpath), 0o700)
    return xdgpath
813501
def exists(provider, config_location=DEFAULT_CONFIG_DIR):
    

    config_dir = os.path.join(config_location, NOIPY_CONFIG)
    auth_file = os.path.join(config_dir, provider)
    return os.path.exists(auth_file)
671199
def store_location
      if request.get? && Adeia.api_patterns.all? { |pattern| /^#{pattern}$/.match(request.path).nil? }
        cookies[:return_to] = { value: request.fullpath, expires: 2.minutes.from_now }
      end
    end
63949
def get_auth(self):
        '''  '''
        return (self._cfgparse.get(self._section, 'username'), self._cfgparse.get(self._section, 'password'))
197308
def cache_path(self, name):
        
        return os.path.join(self._path, self.CACHE_DIR, name)
648944
def get_from_cache(url):
    
    # if the tool is configured to use the cache
    if settings.use_cache:
        # determine the filename by hashing the url
        filename = hashlib.md5(url.encode('utf-8')).hexdigest()

        cache_path_filename = os.path.join(settings.cache_folder, os.extsep.join([filename, 'json']))
        # open the cache file for this url hash if it already exists, otherwise
        # return None
        if os.path.isfile(cache_path_filename):
            with io.open(cache_path_filename, encoding='utf-8') as cache_file:
                response_json = json.load(cache_file)
            log('Retrieved response from cache file "{}" for URL "{}"'.format(cache_path_filename, url))
            return response_json
171163
def check_auth(username, password):
    
    return (username == settings.PRIVATE_INDEX_USERNAME and
            settings.PRIVATE_INDEX_PASSWORD and
            password == settings.PRIVATE_INDEX_PASSWORD)
764903
def check_auth(username, pwd):
    
    cfg = get_current_config()
    return username == cfg["dashboard_httpauth"].split(
        ":")[0] and pwd == cfg["dashboard_httpauth"].split(":")[1]
481296
def cache_path(self):
        
        cache_path = os.path.join(os.path.dirname(__file__), '..', 'cache')
        if not os.path.exists(cache_path):
            os.mkdir(cache_path)
        return cache_path
1240850
def get_default_cache():
    

    xdg_cache_home = os.environ.get('XDG_CACHE_HOME') or \
        os.path.join(os.path.expanduser('~'), '.cache')

    return os.path.join(xdg_cache_home, 'pokebase')
896088
def cookiejar(name='session'):
    
    log = logging.getLogger('ipsv.common.cookiejar')
    spath = os.path.join(config().get('Paths', 'Data'), '{n}.txt'.format(n=name))
    cj = cookielib.LWPCookieJar(spath)
    log.debug('Attempting to load session file: %s', spath)
    if os.path.exists(spath):
        try:
            cj.load()
            log.info('Successfully loaded a saved session / cookie file')
        except cookielib.LoadError as e:
            log.warn('Session / cookie file exists, but could not be loaded', exc_info=e)

    return cj
116022
def find_bookmark_file ():
    
    try:
        dirname = get_profile_dir()
        if os.path.isdir(dirname):
            for name in OperaBookmarkFiles:
                fname = os.path.join(dirname, name)
                if os.path.isfile(fname):
                    return fname
    except Exception:
        pass
    return u""
688522
def _make_bz_instance(opt):
    
    if opt.bztype != 'auto':
        log.info("Explicit --bztype is no longer supported, ignoring")

    cookiefile = None
    tokenfile = None
    use_creds = False
    if opt.cache_credentials:
        cookiefile = opt.cookiefile or -1
        tokenfile = opt.tokenfile or -1
        use_creds = True

    bz = bugzilla.Bugzilla(
        url=opt.bugzilla,
        cookiefile=cookiefile,
        tokenfile=tokenfile,
        sslverify=opt.sslverify,
        use_creds=use_creds,
        cert=opt.cert)
    return bz
679980
def auth(opts, whitelist=None):
    '''
    
    '''
    return LazyLoader(
        _module_dirs(opts, 'auth'),
        opts,
        tag='auth',
        whitelist=whitelist,
        pack={'__salt__': minion_mods(opts)},
    )
874797
def _get_cached_path(
            self,
            field_name,
            path_or_url,
            download_if_missing=False,
            overwrite=False):
        
        if len(field_name) == 0:
            raise ValueError("Expected non-empty field name")
        if len(path_or_url) == 0:
            raise ValueError("Expected non-empty path_or_url")
        return self.download_cache.local_path_or_install_error(
            field_name=field_name,
            path_or_url=path_or_url,
            download_if_missing=download_if_missing,
            overwrite=overwrite)
1211831
function matchPath (ctx) {
    let path = ctx.path
    return path.indexOf(cookie.path) === 0 && path !== '/favicon.ico'
  }
1058884
def session(user, password)
      fname = File.join(ENV['HOME'], '.ruby-bugzilla-cookie.yml')
      if File.exist?(fname) && File.lstat(fname).mode & 0600 == 0600 then
        conf = YAML.load(File.open(fname).read)
        host = @iface.instance_variable_get(:@xmlrpc).instance_variable_get(:@host)
        cookie = conf[host]
        unless cookie.nil? then
          @iface.cookie = cookie
          print "Using cookie\n"
          yield
          conf[host] = @iface.cookie
          File.open(fname, 'w') {|f| f.chmod(0600); f.write(conf.to_yaml)}
          return
        end
      end
      if user.nil? || password.nil? then
        yield
      else
        login({'login'=>user, 'password'=>password, 'remember'=>true})
        yield
        logout
      end
      
    end