code: def print_tokens(output, tokens, style):
      
      assert isinstance(output, Output)
      assert isinstance(style, Style)
  
      # Reset first.
      output.reset_attributes()
      output.enable_autowrap()
  
      # Print all (token, text) tuples.
      attrs_for_token = _TokenToAttrsCache(style.get_attrs_for_token)
  
      for token, text in tokens:
          attrs = attrs_for_token[token]
  
          if attrs:
              output.set_attributes(attrs)
          else:
              output.reset_attributes()
  
          output.write(text)
  
      # Reset again.
      output.reset_attributes()
      output.flush()
docs: Print a list of (Token, text) tuples in the given style to the output.