code: def schedule(target=None, args=(), kwargs=None):
      
      if target is None:
          def decorator(target):
              return schedule(target, args=args, kwargs=kwargs)
          return decorator
      if isinstance(target, compat.greenlet) or target is compat.main_greenlet:
          glet = target
      else:
          glet = greenlet(target, args, kwargs)
      state.paused.append(glet)
      return target
docs: insert a greenlet into the scheduler
  
      If provided a function, it is wrapped in a new greenlet
  
      :param target: what to schedule
      :type target: function or greenlet
      :param args:
          arguments for the function (only used if ``target`` is a function)
      :type args: tuple
      :param kwargs:
          keyword arguments for the function (only used if ``target`` is a
          function)
      :type kwargs: dict or None
  
      :returns: the ``target`` argument
  
      This function can also be used as a decorator, either preloading ``args``
      and/or ``kwargs`` or not:
  
      >>> @schedule
      >>> def f():
      ...     print 'hello from f'
  
      >>> @schedule(args=('world',))
      >>> def f(name):
      ...     print 'hello %s' % name