def _extract_parameters(config, parser, prefix=None):
    """
    Extract parameters from config and set into existent parser object
    :param config: instance or subinstance of CommonData object
    :type config: `libs.CommonData`

    :param parser: argparser instancer
    :type parser: Namedspace

    :param prefix: prefix name for parameter. Used for differentiate submodules params.
    :type prefix: str

    """
    # Shared options
    used_opts = set()
    for x, v in six.iteritems(config.vars):
        # cmd options
        params = ["--%s%s" % (
            # Add sub-module prefix?
            prefix % "%s-" if prefix is not None and AppSettings.parallel_running is True else "",
                  x.replace("_", "-"))
        ]

        if x[0] not in used_opts:
            used_opts.add(x[0])

            # If parameter is form sub-module don't add it
            if AppSettings.parallel_running is False or prefix is None:
                params.append("-%s" % x[0])

        # Type configs
        action, type_ = _resolve_action(v)

        # Properties
        named_params = dict(
            dest=x,
            help=str(v.label),
            default=v.default,
            action=action,
            required=v.required
        )

        if type_ is not None:
            named_params["type"] = type_

        # Field has choices?
        if hasattr(v, "choices"):
            named_params["choices"] = dict(v.choices).keys()

        parser.add_argument(*params, **named_params)


# ----------------------------------------------------------------------
dataset/ETHPy150Open cr0hn/enteletaor/enteletaor_lib/libs/core/cmd.py/_extract_parameters/swapped operands of `%`