docstr: set a consumer for a set of keywords. 
code: def setconsumer(self, keywords, consumer):
      """set a consumer for a set of keywords."""
      # normalize to tuples
      if isinstance(keywords, str):
          keywords = tuple(filter(None, keywords.split()))
      elif hasattr(keywords, "_keywords"):
          keywords = keywords._keywords
      elif not isinstance(keywords, tuple):
          raise TypeError(
              "key %r is not a string or tuple" % (keywords,)
          )
      if consumer is not None and not py.builtin.callable(consumer):
          if not hasattr(consumer, "write"):
              raise TypeError(
                  "%r should be None, callable or file-like"
                  % (consumer,)
              )
          consumer = File(consumer)
      self.keywords2consumer[keywords] = consumer
  
imports: import py
  import sys
label_desc: Use image node_id 5 for calling the KeywordMapper obj's underlying member method code with example usage: obj.setconsumer(keywords, consumer) without return types