code: def print_event(attributes=[]):
      
      def python_callback(event):
          cls_name = event.__class__.__name__
          attrs = ', '.join(['{attr}={val}'.format(attr=attr, val=event.__dict__[attr])
                         for attr in attributes])
          print('{cls_name}({attrs})'.format(cls_name=cls_name, attrs=attrs))
      return python_callback
docs: Function that returns a Python callback to pretty print the events.