def _keep_only_referenced(filenames, contents, strict=False):
  """Returns the filenames referenced from contents.

  If not strict mode, path prefix and extension are optional.
  """
  return [
      fn
      for fn in filenames
      if _search_reference(fn, contents, strict) is not None
  ]
Returns the filenames referenced from contents.

  If not strict mode, path prefix and extension are optional.
  
arxiv_latex_cleaner/arxiv_latex_cleaner.py