code: def for_executor(cls, executor: Optional[Executor]) -> 'Subsystem':
          
          if isinstance(executor, ThreadPoolExecutor):
              return _ThreadingSubsystem(executor)
          elif executor is None:
              return _AsyncioSubsystem()
          else:
              raise TypeError(executor)
docs: Return a subsystem based on the given executor. If ``executor`` is
          None, use :mod:`asyncio`. If ``executor`` is a
          :class:`concurrent.futures.ThreadPoolExecutor`, use :mod:`threading`.
  
          Args:
              executor: The executor in use, if any.