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"]
docstr: Constructs paths to pipeline folder and pipeline json
  Args:
      path: path to json object or to the folder
      create_subdir: bool indicating whether to save pipeline in specified dir or create additional subdir
      is_datetime_in_path: bool indicating whether to save with timestamp or not
  
  :return: paths to pipeline dir and to pipeline json
docstr_tok: ["Constructs","paths","to","pipeline","folder","and","pipeline","json","Args",":","path",":","path","to","json","object","or","to","the","folder","create_subdir",":","bool","indicating","whether","to","save","pipeline","in","specified","dir","or","create","additional","subdir","is_datetime_in_path",":","bool","indicating","whether","to","save","with","timestamp","or","not",":","return",":","paths","to","pipeline","dir","and","to","pipeline","json"]
code: def _prepare_paths(
      path: str, create_subdir: bool, is_datetime_in_path: bool = False
  ) -> Tuple[str, str]:
      """Constructs paths to pipeline folder and pipeline json
      Args:
          path: path to json object or to the folder
          create_subdir: bool indicating whether to save pipeline in specified dir or create additional subdir
          is_datetime_in_path: bool indicating whether to save with timestamp or not
  
      :return: paths to pipeline dir and to pipeline json
      """
  
      path = os.path.abspath(path)
  
      # explicitly specify where to save json, fitted_operation and etc will be saved in the same dir
      if path.endswith(".json"):
          path_to_dir = os.path.split(path)[0]
          if not os.path.exists(path_to_dir):
              os.makedirs(path_to_dir)
          path_to_json = path
          return path_to_dir, path_to_json
  
      if not os.path.exists(path):
          os.makedirs(path)
  
      suffix = "_pipeline_saved"
  
      if not create_subdir:
          path_to_dir = path
          folder_name = os.path.split(path_to_dir)[-1]
          if is_datetime_in_path:
              json_name = f"{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}_{folder_name}"
          else:
              json_name = folder_name
          path_to_json = os.path.join(path_to_dir, f"{json_name}.json")
          return path_to_dir, path_to_json
  
      if is_datetime_in_path:
          folder_name = (
              f"{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}{suffix}"
          )
      else:
          # get index for pipeline
          files_by_path = os.listdir(path)
          max_pipeline_idx = -1
          for file in files_by_path:
              if suffix in file:
                  cur_pipeline_idx = (
                      file.split(suffix)[0]
                      if "_" not in file.split(suffix)[0]
                      else 0
                  )
                  if cur_pipeline_idx.isdigit():
                      cur_pipeline_idx = int(cur_pipeline_idx)
                  else:
                      continue
                  max_pipeline_idx = (
                      cur_pipeline_idx
                      if cur_pipeline_idx > max_pipeline_idx
                      else max_pipeline_idx
                  )
          folder_name = f"{max_pipeline_idx + 1}{suffix}"
  
      path_to_dir = os.path.join(path, folder_name)
      path_to_dir = path_to_dir
      if not os.path.exists(path_to_dir):
          os.makedirs(path_to_dir)
  
      folder_name = os.path.split(path_to_dir)[-1]
      path_to_json = os.path.join(path_to_dir, f"{folder_name}.json")
  
      return path_to_dir, path_to_json
  
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 7 for calling the PipelineTemplate obj's underlying member method code with example usage: obj._prepare_paths(path, create_subdir, is_datetime_in_path) and returns: path_to_dir,  path_to_json, path_to_dir,  path_to_json, path_to_dir,  path_to_json