class_docstr: Pipeline wrapper with 'export_pipeline'/'import_pipeline' methods
  allowing user to upload a pipeline to JSON format and import it from JSON.
  
  :params pipeline: Pipeline object to export or empty Pipeline to import
class_docstr_tok: ["Pipeline","wrapper","with","'export_pipeline'\/'import_pipeline","'","methods","allowing","user","to","upload","a","pipeline","to","JSON","format","and","import","it","from","JSON",".",":","params","pipeline",":","Pipeline","object","to","export","or","empty","Pipeline","to","import"]
code: def convert_to_pipeline(
      self,
      pipeline: "Pipeline",
      path: str = None,
      dict_fitted_operations: dict = None,
  ):
      if path is not None:
          path = os.path.abspath(os.path.dirname(path))
      visited_nodes = {}
      root_template = [
          op_template
          for op_template in self.operation_templates
          if op_template.operation_id == 0
      ][0]
  
      root_node = self.roll_pipeline_structure(
          root_template, visited_nodes, path, dict_fitted_operations
      )
      pipeline.nodes.clear()
      pipeline.add_node(root_node)
  
      preprocessor_file = None
      if path is not None and "preprocessing" in os.listdir(path):
          # Load data preprocessor and store it into the
          preprocessor_file = os.path.join(
              path, "preprocessing", "data_preprocessor.pkl"
          )
      elif (
          dict_fitted_operations
          and "preprocessing" in dict_fitted_operations
      ):
          preprocessor_file = dict_fitted_operations["preprocessing"]
      if preprocessor_file:
          try:
              pipeline.preprocessor = joblib.load(preprocessor_file)
          except ModuleNotFoundError as ex:
              self.log.warning(
                  f"Could not load preprocessor from file `{preprocessor_file}` "
                  f"due to legacy incompatibility. Please refit the preprocessor."
              )
      else:
          pipeline.preprocessor = (
              DataPreprocessor()
              if self.metadata["use_input_preprocessing"]
              else DummyPreprocessor()
          )
  
imports: import json
  import os
  from collections import Counter
  from datetime import datetime
  from io import BytesIO
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
  from uuid import uuid4
  import joblib
  import numpy
  from golem.core.log import default_log
  from fedot.core.operations.atomized_template import AtomizedModelTemplate
  from fedot.core.operations.operation_template import OperationTemplate, check_existing_path
  from fedot.core.pipelines.node import PipelineNode
  from fedot.core.repository.operation_types_repository import atomized_model_type
  from fedot.preprocessing.dummy_preprocessing import DummyPreprocessor
  from fedot.preprocessing.preprocessing import DataPreprocessor
label_desc: Use image node_id 11 for calling the PipelineTemplate obj's underlying member method code with example usage: obj.convert_to_pipeline(pipeline, path, dict_fitted_operations) without return types