# Buggy code
def _parse_params(path_params):
    from flatten_json import unflatten
    from ruamel.yaml import YAMLError

    from dvc.dependency.param import ParamsDependency
    from dvc.utils.serialize import loads_yaml

    ret = {}
    for path_param in path_params:
        path, _, params_str = path_param.rpartition(":")
        # remove empty strings from params, on condition such as `-p "file1:"`
        params = {}
        for param_str in filter(bool, params_str.split(",")):
            try:
                # interpret value strings using YAML rules
                key, value = param_str.split("=")
                params[key] = loads_yaml(value)
            except (ValueError, YAMLError):
                raise InvalidArgumentError(f"Invalid param/value pair '{param_str}'")
        if not path:
            path = ParamsDependency.DEFAULT_PARAMS_FILE
        ret[path] = unflatten(params, ".")
    return ret


# Traceback (ImportError)
2020-08-30 08:57:43,226 DEBUG: fetched: [(3,)]
2020-08-30 08:57:43,228 DEBUG: fetched: [(21770,)]
2020-08-30 08:57:43,246 ERROR: unexpected error - cannot import name 'check_if_numbers_are_consecutive'
------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/dvc/main.py", line 75, in main
ret = cmd.run()
File "/usr/local/lib/python3.6/dist-packages/dvc/command/repro.py", line 47, in run
params=self.args.params,
File "/usr/local/lib/python3.6/dist-packages/dvc/repo/__init__.py", line 34, in wrapper
ret = f(repo, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/dvc/repo/scm_context.py", line 4, in run
result = method(repo, *args, **kw)
File "/usr/local/lib/python3.6/dist-packages/dvc/repo/reproduce.py", line 74, in reproduce
params = _parse_params(kwargs.pop("params", []))
File "/usr/local/lib/python3.6/dist-packages/dvc/repo/reproduce.py", line 122, in _parse_params
from flatten_json import unflatten
File "/usr/local/lib/python3.6/dist-packages/flatten_json.py", line 13, in <module>
from util import check_if_numbers_are_consecutive
ImportError: cannot import name 'check_if_numbers_are_consecutive'
------------------------------------------------------------
Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
2020-08-30 08:57:43,249 DEBUG: Analytics is enabled.
2020-08-30 08:57:43,279 DEBUG: Trying to spawn '['daemon', '-q', 'analytics', '/tmp/tmpkskduifx']'
2020-08-30 08:57:43,280 DEBUG: Spawned '['daemon', '-q', 'analytics', '/tmp/tmpkskduifx']'

# Fixed code
def _parse_params(path_params):
    from ruamel.yaml import YAMLError

    from dvc.dependency.param import ParamsDependency
    from dvc.utils.flatten import unflatten
    from dvc.utils.serialize import loads_yaml

    ret = {}
    for path_param in path_params:
        path, _, params_str = path_param.rpartition(":")
        # remove empty strings from params, on condition such as `-p "file1:"`
        params = {}
        for param_str in filter(bool, params_str.split(",")):
            try:
                # interpret value strings using YAML rules
                key, value = param_str.split("=")
                params[key] = loads_yaml(value)
            except (ValueError, YAMLError):
                raise InvalidArgumentError(f"Invalid param/value pair '{param_str}'")
        if not path:
            path = ParamsDependency.DEFAULT_PARAMS_FILE
        ret[path] = unflatten(params)
    return ret