code: def create_mock_components():
      class _MockScheduler(FIFOScheduler):
          errored_trials = []
  
          def on_trial_error(self, tune_controller, trial):
              self.errored_trials += [trial]
  
      class _MockSearchAlg(BasicVariantGenerator):
          errored_trials = []
  
          def on_trial_complete(self, trial_id, error=False, **kwargs):
              if error:
                  self.errored_trials += [trial_id]
  
      searchalg = _MockSearchAlg()
      scheduler = _MockScheduler()
      return searchalg, scheduler
  
imports: import json
  import logging
  import os
  import tempfile
  from unittest import mock
  import pytest
  import sys
  import time
  from functools import partial
  import ray
  from freezegun import freeze_time
  from ray.train import CheckpointConfig
  from ray.air.execution import FixedResourceManager, PlacementGroupResourceManager
  from ray.air.constants import TRAINING_ITERATION
  from ray.train import Checkpoint
  from ray.train._internal.session import _TrainingResult
  from ray.train._internal.storage import StorageContext
  from ray.tune import PlacementGroupFactory
  from ray.tune.execution.tune_controller import TuneController
  from ray.tune.experiment import Trial
  from ray.tune.result import DONE
  from ray.tune.schedulers import FIFOScheduler
  from ray.tune.search import BasicVariantGenerator
  from ray.train.tests.util import mock_storage_context
  from ray.tune.tests.tune_test_util import TrialResultObserver
label_desc: Use image node_id 2 for calling a global function with example usage: create_mock_components() and returns: searchalg,  scheduler