code: def init_cache(self):
      use_pipelines_cache = self.params.get("use_pipelines_cache")
      use_preprocessing_cache = self.params.get(
          "use_preprocessing_cache"
      )
      use_input_preprocessing = self.params.get(
          "use_input_preprocessing"
      )
      cache_dir = self.params.get("cache_dir")
      if use_pipelines_cache:
          self.pipelines_cache = OperationsCache(cache_dir)
          #  in case of previously generated singleton cache
          self.pipelines_cache.reset()
      if use_input_preprocessing and use_preprocessing_cache:
          self.preprocessing_cache = PreprocessingCache(cache_dir)
          #  in case of previously generated singleton cache
          self.preprocessing_cache.reset()
  
imports: import datetime
  import gc
  from copy import deepcopy
  from typing import List, Optional, Sequence, Tuple, Union
  from golem.core.log import default_log
  from golem.core.optimisers.opt_history_objects.opt_history import OptHistory
  from golem.core.tuning.simultaneous import SimultaneousTuner
  from fedot.api.api_utils.assumptions.assumptions_handler import AssumptionsHandler
  from fedot.api.api_utils.params import ApiParams
  from fedot.api.time import ApiTime
  from fedot.core.caching.pipelines_cache import OperationsCache
  from fedot.core.caching.preprocessing_cache import PreprocessingCache
  from fedot.core.composer.composer_builder import ComposerBuilder
  from fedot.core.composer.gp_composer.gp_composer import GPComposer
  from fedot.core.constants import DEFAULT_TUNING_ITERATIONS_NUMBER
  from fedot.core.data.data import InputData
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.pipelines.tuning.tuner_builder import TunerBuilder
  from fedot.core.repository.metrics_repository import MetricIDType
label_desc: Use image node_id 2 for calling the ApiComposer obj's underlying member method code with example usage: obj.init_cache() without return types