code: def from_core_operation(
      cls,
      operation: operation_lib.Operation,
  ):
      polling = getattr(operation, "_polling", None)
      retry = getattr(operation, "_retry", None)
      if polling is not None:
          # google.api_core v 2.11
          kwargs = {"polling": polling}
      elif retry is not None:
          # google.api_core v 2.10
          kwargs = {"retry": retry}
      else:
          kwargs = {}
      return cls(
          operation=operation._operation,
          refresh=operation._refresh,
          cancel=operation._cancel,
          result_type=operation._result_type,
          metadata_type=operation._metadata_type,
          **kwargs,
      )
  
file_path: generative-ai-python/google/generativeai/operations.py
imports: from __future__ import annotations
  import functools
  from typing import Iterator
  from google.ai import generativelanguage
  from google.generativeai import client
  from google.generativeai.types import model_types
  from google.api_core import operation
  import tqdm.auto
label_desc: Use image node_id 2 for calling the CreateTunedModelOperation obj's underlying member method code with example usage: obj.from_core_operation(cls, operation) and returns: cls