def convert(_automatic=False, **mappings):
    def decorator(func):
        target = func
        while hasattr(target, '__wrapped__'):
            target = getattr(target, '__wrapped__')
        sig = signature(target)
        if _automatic:
            for param in sig.parameters.values():
                if param.name in mappings or param.default is param.empty:
                    continue
                converter = CONVERTERS.get(type(param.default))
                if converter:
                    mappings[param.name] = converter(param.default)
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            args = list(args)
            for pos, param in enumerate(sig.parameters.values()):
                if param.name not in mappings:
                    continue
                if param.kind == param.POSITIONAL_ONLY:
                    args[pos] = mappings[param.name](args[pos])
                if param.kind == param.POSITIONAL_OR_KEYWORD:
                    if param.name in kwargs and \
                            kwargs[param.name] is not param.default:
                        kwargs[param.name] = mappings[param.name](
                                kwargs[param.name])
                    elif pos < len(args) and \
                            args[pos] is not param.default:
                        args[pos] = mappings[param.name](args[pos])
                if param.kind == param.KEYWORD_ONLY and \
                        kwargs[param.name] is not param.default:
                    kwargs[param.name] = mappings[param.name](
                            kwargs[param.name])
                if param.kind == param.VAR_POSITIONAL:
                    start = pos
                    for pos in range(start, len(args)):
                        args[pos] = mappings[param.name](args[pos])
                if param.kind == param.VAR_KEYWORD:
                    msg = 'Variable length keyword arguments not supported'
                    raise ValueError(msg)
            return func(*args, **kwargs)
        # do not skipping decorators when unwinding wrapping
        wrapper.__wrapped__ = func
        return wrapper
    return decorator
Add attributes to a prefix
dataset/ETHPy150Open aliles/begins/begin/convert.py/convert--crossover with--dataset/ETHPy150Open SpriteLink/NIPAP/nipap-cli/nipap_cli/nipap_cli.py/prefix_attr_add