code: def _get_schema_version(counterfactuals_dict):
      """
      Get the version from the serialized version of the
      counterfactual examples.
  
      :param counterfactuals_dict: Serialized version of the
                                   counterfactual example.
      :type counterfactuals_dict: Dict
      """
      if _CommonSchemaConstants.METADATA not in counterfactuals_dict:
          raise SchemaErrorException(
              "No metadata field found in serialized counterfactual output"
          )
  
      metadata = counterfactuals_dict[_CommonSchemaConstants.METADATA]
      if _CommonSchemaConstants.VERSION not in metadata:
          raise SchemaErrorException(
              "No version field found in serialized counterfactual output"
          )
  
      version = metadata[_CommonSchemaConstants.VERSION]
      if version not in _SchemaVersions.ALL_VERSIONS:
          raise SchemaErrorException(
              "Schema version {0} not supported."
              "Support versions are {1}".format(
                  version, ",".join(_SchemaVersions.ALL_VERSIONS)
              )
          )
  
      return version
  
imports: import json
  import uuid
  import warnings
  from pathlib import Path
  from typing import Any, List, Optional, Union
  import dice_ml
  import jsonschema
  import numpy
  import pandas
  from dice_ml import Dice
  from dice_ml.counterfactual_explanations import CounterfactualExplanations
  from dice_ml.explainer_interfaces.explainer_base import ExplainerBase
  from raiutils.exceptions import UserConfigValidationException
  from raiutils.models import ModelTask
  from responsibleai._config.base_config import BaseConfig
  from responsibleai._data_validations import validate_train_test_categories
  from responsibleai._interfaces import CounterfactualData
  from responsibleai._internal.constants import CounterfactualManagerKeys, FileFormats, ListProperties, ManagerNames
  from responsibleai._tools.shared.state_directory_management import DirectoryManager
  from responsibleai.exceptions import DuplicateManagerConfigException, SchemaErrorException
  from responsibleai.managers.base_manager import BaseManager
  from responsibleai.utils import _find_features_having_missing_values, _measure_time
label_desc: Use image node_id 1 for calling a global function with example usage: _get_schema_version(counterfactuals_dict) and returns: version