code: def test_custom_feature_connector(tmp_path: pathlib.Path):
      module_name = "tensorflow_datasets.core.features.test_feature"
      feature_qualname = f"{module_name}.CustomFeatureConnector"
      assert module_name not in sys.modules
      assert (
          feature_qualname
          not in features_lib.FeatureConnector._registered_features
      )
  
      # Save tfds.feature.Tensor to avoid importing the custom feature connector
      feature = features_lib.Tensor(shape=(), dtype=np.int32)
      feature.save_config(tmp_path)
  
      # Update the features.json file to simulate as if the original
      # FeatureConnector had been save
      feature_path = tmp_path / "features.json"
      content = feature_path.read_text()
      content = content.replace(
          "tensorflow_datasets.core.features.tensor_feature.Tensor",
          feature_qualname,
      )
      feature_path.write_text(content)
  
      # Loading will load the custom feature connector, even if it is not
      # registered yet.
      feature = features_lib.FeatureConnector.from_config(tmp_path)
  
      # After loading, the custom feature connector is registered
      assert module_name in sys.modules
      assert (
          feature_qualname
          in features_lib.FeatureConnector._registered_features
      )
  
      # Check that the loaded feature is the custom feature
      from tensorflow_datasets.core.features import (
          test_feature,
      )  # pylint: disable=g-import-not-at-top
  
      assert isinstance(feature, test_feature.CustomFeatureConnector)
  
imports: import pathlib
  import sys
  import textwrap
  from unittest import mock
  from absl import logging
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import features
label_desc: Use image node_id 1 for calling a global function with example usage: test_custom_feature_connector(tmp_path) without return types