docs: def _createFuture(func, *args, **kwargs):
      """Helper function to create a future."""
      assert callable(func), (
          "The provided func parameter is not a callable."
      )
  
      if scoop.IS_ORIGIN and "SCOOP_WORKER" not in sys.modules:
          sys.modules["SCOOP_WORKER"] = sys.modules["__main__"]
  
      # If function is a lambda or class method, share it (or its parent object)
      # beforehand
      lambdaType = type(lambda: None)
      funcIsLambda = isinstance(func, lambdaType) and func.__name__ == '<lambda>'
      # Determine if function is a method. Methods derived from external
      # languages such as C++ aren't detected by ismethod.
      funcIsMethod = ismethod(func)
      if funcIsLambda or funcIsMethod:
          from .shared import SharedElementEncapsulation
          func = SharedElementEncapsulation(func)
  
      return Future(control.current.id, func, *args, **kwargs)