@staticmethod
  def is_file_accessible(filename):
    if not isinstance(filename, basestring):
      raise TypeError()
    # Blindly follow symlinks here. DO NOT use os.path.realpath. This approach
    # enables the application developer to create symlinks in their
    # application directory to any additional libraries they want to use.
    fixed_filename = os.path.normcase(os.path.abspath(filename))

    # Some of the access checks are expensive as they look through a list of
    # regular expressions for a match.  As long as app.yaml isn't changed the
    # answer will always be the same as it's only depending on the filename and
    # the configuration, not on which files do exist or not.
    with FakeFile._availability_cache_lock:
      result = FakeFile._availability_cache.get(fixed_filename)
    if result is None:
      if (_is_path_in_directories(fixed_filename, [FakeFile._root_path]) and
          fixed_filename != FakeFile._root_path):
        relative_filename = fixed_filename[len(FakeFile._root_path):].lstrip(
            os.path.sep)
        block_access = (FakeFile._skip_files.match(relative_filename) or
                        FakeFile._static_files.match(relative_filename))
      else:
        block_access = False
      result = not block_access and (
          fixed_filename in FakeFile.ALLOWED_FILES or
          _is_path_in_directories(fixed_filename, FakeFile._allowed_dirs))
      with FakeFile._availability_cache_lock:
        FakeFile._availability_cache[fixed_filename] = result
    return result
Determines if a file is accessible.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/python/stubs.py/FakeFile.is_file_accessible