4e0f1b51db0a78331509be2f3c95a4ed29f6b0c5,tensorflow_datasets/core/registered.py,,_dataset_name_and_kwargs_from_name_str,#Any#,198

Before Change


    kwarg_strs = kwargs_str.split(",")
    kwargs = {}
    for kwarg_str in kwarg_strs:
      kwarg_name, kwarg_val = kwarg_str.split("=")
      kwargs[kwarg_name] = _cast_to_pod(kwarg_val)
    return dataset_name, kwargs
  except:

After Change



def _dataset_name_and_kwargs_from_name_str(name_str):
  Extract kwargs from name str.
  num_slashes = name_str.count("/")
  has_kwargs = "," in name_str or "=" in name_str

  try:
    if not num_slashes:
      // 1. dataset_name
      if has_kwargs:
        raise ValueError(_NAME_STR_ERR)
      return name_str, {}

    name_splits = name_str.split("/")
    if has_kwargs:
      if num_slashes == 1:
        // 2. dataset_name/kwargs
        dataset_name, kwargs_str = name_splits
        config = None
      else:
        if num_slashes > 2:
          raise ValueError(_NAME_STR_ERR)
        assert num_slashes == 2
        // 3. dataset_name/config_name/kwargs
        dataset_name, config, kwargs_str = name_splits
    else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: tensorflow/datasets
Commit Name: 4e0f1b51db0a78331509be2f3c95a4ed29f6b0c5
Time: 2018-12-13
Author: rsepassi@google.com
File Name: tensorflow_datasets/core/registered.py
Class Name:
Method Name: _dataset_name_and_kwargs_from_name_str


Project Name: MTG/freesound
Commit Name: 0f7bacc26eec44c9f00f5d7666c1f87f0e051ce2
Time: 2017-11-10
Author: andres.ferraro@upf.edu
File Name: search/management/commands/post_dirty_sounds_to_solr.py
Class Name: Command
Method Name: handle


Project Name: sahana/eden
Commit Name: a07128d0d5098590375dc089daa3acc874ee668e
Time: 2018-12-11
Author: dominic@nursix.org
File Name: modules/s3/s3delete.py
Class Name: S3Delete
Method Name: check_deletable