code: def _operation_to_template(
      self, node: PipelineNode, operation_id: int, nodes_from: list
  ):
      self.operation_id = operation_id
      if not isinstance(node.operation, str):
          # for model-based operations
          self.operation_type = node.operation.operation_type
          self.custom_params = node.parameters
          self.params = self._create_full_params(node)
  
          if _is_node_fitted(node):
              self.operation_name = _extract_operation_name(node)
              self._extract_fields_of_fitted_operation(node)
      else:
          # for custom operations without implementation
          self.operation_type = "custom"
          self.custom_params = {}
          self.params = {}
          self.operation_name = node.operation
      self.nodes_from = nodes_from
      self.rating = node.rating
  
imports: import os
  from abc import ABC, abstractmethod
  from io import BytesIO
  from typing import Any, Optional, Union
  import joblib
  import numpy
  from golem.core.log import default_log
  from fedot.core.pipelines.node import PipelineNode
label_desc: Use image node_id 2 for calling the OperationTemplate obj's underlying member method code with example usage: obj._operation_to_template(node, operation_id, nodes_from) without return types