code: def _dataset_name_and_kwargs_from_name_str(
      name_str: str,
  ) -> Tuple[str, Dict[str, Value]]:
      """Extract kwargs from name str."""
      err_msg = textwrap.dedent(
          f"""\
        Parsing builder name string {name_str} failed.
        The builder name string must be of the following format:
          dataset_name[/config_name][:version][/kwargs]
  
          Where:
  
            * dataset_name and config_name are string following python variable naming.
            * version is of the form x.y.z where {{x,y,z}} can be any digit or *.
            * kwargs is a comma list separated of arguments and values to pass to
              builder.
  
          Examples:
            my_dataset
            my_dataset:1.2.*
            my_dataset/config1
            my_dataset/config1:1.*.*
            my_dataset/config1/arg1=val1,arg2=val2
            my_dataset/config1:1.2.3/right=True,foo=bar,rate=1.2
        """
      )
  
      res = _NAME_REG.match(name_str)
      if not res:
          raise ValueError(err_msg)
      name = res.group("dataset_name")
      # Normalize the name to accept CamelCase
      name = camelcase_to_snakecase(name)
      kwargs = _kwargs_str_to_kwargs(res.group("kwargs"))
      try:
          for attr in ["config", "version"]:
              val = res.group(attr)
              if val is None:
                  continue
              if attr in kwargs:
                  raise ValueError(
                      "Dataset %s: cannot pass %s twice." % (name, attr)
                  )
              kwargs[attr] = val
          return name, kwargs
      except Exception as e:  # pylint: disable=broad-except
          py_utils.reraise(e, prefix=err_msg)
  
imports: from __future__ import annotations
  import dataclasses
  import functools
  import os
  import re
  import textwrap
  from typing import Any, Dict, List, Mapping, MutableMapping, Optional, Tuple, Union
  from absl import logging
  from etils import epath
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import version
label_desc: Use image node_id 4 for calling a global function with example usage: _dataset_name_and_kwargs_from_name_str(name_str) and returns: name,  kwargs