text: """
  Parla is a parallel language for orchestrating high-performance array-based programs.
  "Orchestration" refers to controlling lower-level operations from a higher-level language.
  In this case, Parla orchestrates low-level array operations and other existing high-performance operations (written in C, C++, or FORTRAN).
  """
  from typing import Collection
  
  from parla import task_runtime
  from parla.device import get_all_devices
  from parla.environments import TaskEnvironment
  
  __all__ = ["Parla", "multiload", "TaskEnvironment"]
  
  
  class Parla:
      environments: Collection[TaskEnvironment]
      _sched: task_runtime.Scheduler
  
      def __init__(self, environments: Collection[TaskEnvironment]=None, scheduler_class=task_runtime.Scheduler, **kwds):
          assert issubclass(scheduler_class, task_runtime.Scheduler)
          environments = environments or [TaskEnvironment(placement=[d]) for d in get_all_devices()]
          self.environments = environments
          self.scheduler_class = scheduler_class
          self.kwds = kwds
  
      def __enter__(self):
          if hasattr(self, "_sched"):
              raise ValueError("Do not use the same Parla object more than once.")
          self._sched = self.scheduler_class(self.environments, **self.kwds)
          return self._sched.__enter__()
  
      def __exit__(self, exc_type, exc_val, exc_tb):
          try:
              return self._sched.__exit__(exc_type, exc_val, exc_tb)
          finally:
              del self._sched
  