code: def compose_pipeline(self, data: InputData) -> Pipeline:
      data_producer = DataSourceSplitter(shuffle=True).build(data)
      train_data, test_data = next(data_producer())
  
      def prepared_objective(pipeline: Pipeline) -> Fitness:
          pipeline.fit(train_data)
          return self.optimizer.objective(
              pipeline, reference_data=test_data
          )
  
      best_pipeline = self.optimizer.optimise(prepared_objective)[0]
      return best_pipeline
  
file_path: FEDOT/fedot/core/composer/random_composer.py
imports: from golem.core.optimisers.fitness import Fitness
  from golem.core.optimisers.random.random_search import RandomSearchOptimizer
  from fedot.core.composer.composer import Composer
  from fedot.core.data.data import InputData
  from fedot.core.optimisers.objective.data_source_splitter import DataSourceSplitter
  from fedot.core.pipelines.pipeline import Pipeline
label_desc: Use image node_id 2 for calling the RandomSearchComposer obj's underlying member method code with example usage: obj.compose_pipeline(data) and returns: best_pipeline, self