class_docstr: Manage a collection of events and a sequence of callbacks for each.
  
  This is attached to :class:`~IPython.core.interactiveshell.InteractiveShell`
  instances as an ``events`` attribute.
  
  .. note::
  
     This API is experimental in IPython 2.0, and may be revised in future versions.
class_docstr_tok: ["Manage","a","collection","of","events","and","a","sequence","of","callbacks","for","each",".","This","is","attached","to",":","class",":","`","~IPython.core.interactiveshell.InteractiveShell","`","instances","as","an","``","events","``","attribute",".","..","note",":",":","This","API","is","experimental","in","IPython","2.0",",","and","may","be","revised","in","future","versions","."]
docstr: Register a new event callback
  
  Parameters
  ----------
  event : str
    The event for which to register this callback.
  function : callable
    A function to be called on the given event. It should take the same
    parameters as the appropriate callback prototype.
  
  Raises
  ------
  TypeError
    If ``function`` is not callable.
  KeyError
    If ``event`` is not one of the known events.
docstr_tok: ["Register","a","new","event","callback","Parameters","--","--","--","--","--","event",":","str","The","event","for","which","to","register","this","callback",".","function",":","callable","A","function","to","be","called","on","the","given","event",".","It","should","take","the","same","parameters","as","the","appropriate","callback","prototype",".","Raises","--","--","--","TypeError","If","``","function","``","is","not","callable",".","KeyError","If","``","event","``","is","not","one","of","the","known","events","."]
code: def register(self, event, function):
      """Register a new event callback
  
      Parameters
      ----------
      event : str
        The event for which to register this callback.
      function : callable
        A function to be called on the given event. It should take the same
        parameters as the appropriate callback prototype.
  
      Raises
      ------
      TypeError
        If ``function`` is not callable.
      KeyError
        If ``event`` is not one of the known events.
      """
      if not callable(function):
          raise TypeError("Need a callable, got %r" % function)
      self.callbacks[event].append(function)
  
file_path: catboost/contrib/python/ipython/py2/IPython/core/events.py
imports: from __future__ import print_function
label_desc: Use image node_id 2 for calling the EventManager obj's underlying member method code with example usage: obj.register(event, function) without return types