code: def checkcache(filename=None, opts=False):
      
  
      if isinstance(opts, dict):
          use_linecache_lines = opts['use_linecache_lines']
      else:
          use_linecache_lines = opts
          pass
  
      if not filename:
          filenames = list(file_cache.keys())
      elif filename in file_cache:
          filenames = [filename]
      else:
          return None
  
      result = []
      for filename in filenames:
          if filename not in file_cache: continue
          path = file_cache[filename].path
          if os.path.exists(path):
              cache_info = file_cache[filename].stat
              stat = os.stat(path)
              if stat and \
                      (cache_info.st_size != stat.st_size or
                           cache_info.st_mtime != stat.st_mtime):
                  result.append(filename)
                  update_cache(filename, use_linecache_lines)
              else:
                  result.append(filename)
                  update_cache(filename)
                  pass
          pass
      return result
docs: Discard cache entries that are out of date. If *filename* is *None*
      all entries in the file cache *file_cache* are checked.  If we do not
      have stat information about a file it will be kept. Return a list of
      invalidated filenames.  None is returned if a filename was given but
      not found cached.