def call(self, function, *args, **kwds):
      """
      Check if function is a method of an instance of pseudo_threads.
      If so, call this method via the pseudo_thread mechanism
      """
      special =  hasattr(function, "_parallel")
      if special:
         return (None, function(self.this_function, *args, **kwds))
      else:
         return (function(*args, **kwds), self.this_function)

      Check if function is a method of an instance of pseudo_threads.
      If so, call this method via the pseudo_thread mechanism
      
recipes/Python/474127_Simulating_concurrency/recipe-474127.py