code: def test_encode_and_dtype_from_str():
      dtypes = [
          tf.int64,
          tf.string,
          tf.bfloat16,
          tf.bool,
          np.int64,
          np.bool_,
          np.object_,
          np.uint8,
      ]
      for dtype in dtypes:
          assert (
              feature.dtype_from_str(feature.dtype_to_str(dtype))
              == dtype
          )
  
imports: import numpy
  import pytest
  import tensorflow
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.features import image_feature
  from tensorflow_datasets.core.proto import feature_pb2
label_desc: Use image node_id 12 for calling a global function with example usage: test_encode_and_dtype_from_str() without return types