code: def report(location, document):
      
      assert isinstance(location, six.string_types)
  
      if location.endswith('.py'):
          return report_pyflakes(document)
      else:
          return []
docs: Run reporter on document and return list of ReporterError instances.
      (Depending on the location it will or won't run anything.)
  
      Returns a list of `ReporterError`.