code: def printer():
      class Printer:
          def __init__(self):
              self.buffer = io.StringIO()
  
          def __call__(self, text):
              print(text, file=self.buffer)
  
          def __repr__(self):
              return self.buffer.getvalue()
  
      return Printer()
  
file_path: river/river/time_series/test_holt_winters.py
imports: from __future__ import annotations
  import io
  import pytest
  from river.time_series import HoltWinters
label_desc: Use image node_id 1 for calling a global function with example usage: printer() and returns: Printer, self