def contains(bank, key, cachedir):
    '''
    Checks if the specified bank contains the specified key.
    '''
    if key is None:
        base = os.path.join(cachedir, os.path.normpath(bank))
        return os.path.isdir(base)
    else:
        keyfile = os.path.join(cachedir, os.path.normpath(bank), '{0}.p'.format(key))
        return os.path.isfile(keyfile)
Checks if the specified bank contains the specified key.