code: def _dataset_name_and_kwargs_from_name_str(name_str):
    
    res = _NAME_REG.match(name_str)
    if not res:
      raise ValueError(_NAME_STR_ERR.format(name_str))
    name = res.group("dataset_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:
      logging.error(_NAME_STR_ERR.format(name_str))   # pylint: disable=logging-format-interpolation
      raise
docs: Extract kwargs from name str.