code: def test_get_version_str(mock_fs: testing.MockFs):
      mock_fs.add_file("path/to/ds/1.0.0/features.json")
      mock_fs.add_file("path/to/ds/1.0.1/features.json")
      mock_fs.add_file("path/to/ds/1.1.0/features.json")
      mock_fs.add_file("path/to/ds/2.0.1/features.json")
  
      get_version_str = functools.partial(
          read_only_builder._get_version_str,
          "path/to/ds/",  # pylint: disable=protected-access
      )
  
      with error_utils.reraise_with_context(
          registered.DatasetNotFoundError
      ):
          # requested_version is None -> Returns last version
          assert get_version_str(requested_version=None) == "2.0.1"
          # Returns highest matching version
          assert get_version_str(requested_version="1.*.*") == "1.1.0"
          assert get_version_str(requested_version="*.*.*") == "2.0.1"
          assert get_version_str(requested_version="1.0.0") == "1.0.0"
          # No matching version found
          assert get_version_str(requested_version="1.3.*") is None
          assert get_version_str(requested_version="2.3.5") is None
  
          assert _find_builder_dir("ds") == "path/to/ds/2.0.1"
          assert _find_builder_dir("ds:*.*.*") == "path/to/ds/2.0.1"
          assert _find_builder_dir("ds:1.*.*") == "path/to/ds/1.1.0"
          assert _find_builder_dir("ds:1.0.0") == "path/to/ds/1.0.0"
          assert _find_builder_dir("ds:1.3.*") is None
          assert _find_builder_dir("ds:2.3.5") is None
  
      # No matching version found, updated error context.
      requested_version = "1.3.*"
      builder_dir = "path/to/ds/"
      error_msg = (
          f"No version matching the requested {requested_version} was "
          f"found in the builder directory: {builder_dir}."
      )
  
      with _assert_raises(error_msg):
          assert (
              get_version_str(requested_version=requested_version)
              is None
          )
  
imports: import contextlib
  import functools
  import os
  import pathlib
  import re
  from typing import Sequence
  from unittest import mock
  import dill
  from etils import epath
  import pytest
  import tensorflow
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import constants
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import dataset_utils
  from tensorflow_datasets.core import load
  from tensorflow_datasets.core import proto
  from tensorflow_datasets.core import read_only_builder
  from tensorflow_datasets.core import registered
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import features_dict
  from tensorflow_datasets.core.proto import dataset_info_pb2
  from tensorflow_datasets.core.utils import error_utils
  from tensorflow_datasets.core.utils import file_utils
  from google.protobuf import json_format
label_desc: Use image node_id 22 for calling a global function with example usage: test_get_version_str(mock_fs) without return types