code: def extend(func):
      
      def callback(context, name, ob):
          obj = context.context
          if info.scope == 'class':
              f = getattr(obj.get_plugin(ob), func.__name__)
          else:
              f = func
          setattr(obj, f.__name__, f.__get__(obj, obj.__class__))
      info = venusian.attach(func, callback, category='irc3.extend')
      return func
docs: Allow to extend a bot:
  
      Create a module with some useful routine:
  
      .. literalinclude:: ../examples/myextends.py
      ..
          >>> import sys
          >>> sys.path.append('examples')
          >>> from irc3 import IrcBot
          >>> IrcBot.defaults.update(asynchronous=False, testing=True)
  
      Now you can use those routine in your bot::
  
          >>> bot = IrcBot()
          >>> bot.include('myextends')
          >>> print(bot.my_usefull_function(1))
          my_usefull_function(*(1,))
          >>> print(bot.my_usefull_method(2))
          my_usefull_method(*(2,))