code: def test_several_automl_instances_can_run_in_parallel():
      # this is not a recommended behaviour, but this should work nonetheless.
      parallel = 5
      models_per_run = 3
      amls = [
          H2OAutoML(max_models=models_per_run, nfolds=0, seed=1)
          for _ in range(parallel)
      ]
      ds = import_dataset()
  
      with ThreadPoolExecutor(max_workers=parallel) as executor:
          for i, aml in enumerate(amls):
              train = partial(
                  aml.train,
                  y=ds.target,
                  training_frame=ds.train,
                  leaderboard_frame=ds.test,
              )
              executor.submit(train)
  
      project_names = [aml.project_name for aml in amls]
      print(project_names)
      assert len(set(project_names)) == parallel
      leaderboards = [aml.leaderboard for aml in amls]
      models = flatten(
          [[lb[i, 0] for i in range(lb.nrows)] for lb in leaderboards]
      )
      print(models)
      assert len(set(models)) == parallel * models_per_run
  
file_path: h2o-3/h2o-py/tests/testdir_algos/automl/pyunit_automl_concurrent_runs.py
imports: from concurrent.futures import ThreadPoolExecutor
  from functools import partial
  from itertools import chain
  import os
  import sys
  from h2o.automl import H2OAutoML
  from tests import pyunit_utils
  from _automl_utils import import_dataset
label_desc: Use image node_id 2 for calling a global function with example usage: test_several_automl_instances_can_run_in_parallel() without return types