<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def decorator_with_args(func, return_original=False, target_pos=0):
 """Enable a function to work with a decorator with arguments Args: func (callable):
 The input function. return_original (bool):
 Whether the resultant decorator returns the decorating target unchanged. If True, will return the target unchanged. Otherwise, return the returned value from *func*. Default to False. This is useful for converting a non-decorator function to a decorator. See examples below. Return: callable: a decorator with arguments. Examples: Registering plugin1 with arg1=10 Registering plugin1 with arg1=10 Registering plugin2 with arg1=100 """

    if sys.version_info[0] >= 3:
        target_name = inspect.getfullargspec(func).args[target_pos]
    else:
        target_name = inspect.getargspec(func).args[target_pos]
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        if  len(args) > target_pos:
            res = func(*args, **kwargs)
            return args[target_pos] if return_original else res
        elif len(args) <= 0 and target_name in kwargs:
            res = func(*args, **kwargs)
            return kwargs[target_name] if return_original else res
        else:
            return wrap_with_args(*args, **kwargs)

    def wrap_with_args(*args, **kwargs):
        def wrapped_with_args(target):
            kwargs2 = dict()
            kwargs2[target_name] = target
            kwargs2.update(kwargs)
            res = func(*args,  **kwargs2)
            return target if return_original else res
        return wrapped_with_args

    return wrapper