code: def run(input, conf, filepath=None):
      
      if conf.is_file_ignored(filepath):
          return ()
  
      if isinstance(input, (type(b''), type(u''))):  # compat with Python 2 & 3
          return _run(input, conf, filepath)
      elif hasattr(input, 'read'):  # Python 2's file or Python 3's io.IOBase
          # We need to have everything in memory to parse correctly
          content = input.read()
          return _run(content, conf, filepath)
      else:
          raise TypeError('input should be a string or a stream')
docs: Lints a YAML source.
  
      Returns a generator of LintProblem objects.
  
      :param input: buffer, string or stream to read from
      :param conf: yamllint configuration object