def accepts_scalar_input2(argx_list=[0], outer_wrapper=True):
    r"""
    FIXME: change to better name. Complete implementation.

    used in IBEIS setters

    accepts_scalar_input2 is a decorator which expects to be used on class
    methods.  It lets the user pass either a vector or a scalar to a function,
    as long as the function treats everything like a vector. Input and output
    is sanitized to the user expected format on return.

    Args:
        argx_list (list): indexes of args that could be passed in as scalars to
            code that operates on lists. Ensures that decorated function gets
            the argument as an iterable.
    """
    assert isinstance(argx_list, (list, tuple)), (
        'accepts_scalar_input2 must be called with argument positions')

    def closure_asi2(func):
        #@on_exception_report_input
        @ignores_exc_tb(outer_wrapper=False)
        def wrp_asi2(self, *args, **kwargs):
            # Hack in case wrapping a function with varargs
            argx_list_ = [argx for argx in argx_list if argx < len(args)]
            __assert_param_consistency(args, argx_list_)
            if all([util_iter.isiterable(args[ix]) for ix in argx_list_]):
                # If input is already iterable do default behavior
                return func(self, *args, **kwargs)
            else:
                # If input is scalar, wrap input, execute, and unpack result
                args_wrapped = [(arg,) if ix in argx_list_ else arg
                                for ix, arg in enumerate(args)]
                ret = func(self, *args_wrapped, **kwargs)
                if ret is not None:
                    return ret[0]
        if outer_wrapper:
            wrp_asi2 = on_exception_report_input(preserve_sig(wrp_asi2, func))
        return wrp_asi2
    return closure_asi2
def accepts_scalar_input2 ( argx_list = [ 0 ] , outer_wrapper = True ) : assert isinstance ( argx_list , ( list , tuple ) ) , ( 'accepts_scalar_input2 must be called with argument positions' ) def closure_asi2 ( func ) : @ ignores_exc_tb ( outer_wrapper = False ) def wrp_asi2 ( self , * args , ** kwargs ) : argx_list_ = [ argx for argx in argx_list if argx < len ( args ) ] __assert_param_consistency ( args , argx_list_ ) if all ( [ util_iter . isiterable ( args [ ix ] ) for ix in argx_list_ ] ) : return func ( self , * args , ** kwargs ) else : args_wrapped = [ ( arg , ) if ix in argx_list_ else arg for ix , arg in enumerate ( args ) ] ret = func ( self , * args_wrapped , ** kwargs ) if ret is not None : return ret [ 0 ] if outer_wrapper : wrp_asi2 = on_exception_report_input ( preserve_sig ( wrp_asi2 , func ) ) return wrp_asi2 return closure_asi2
r"""
    FIXME: change to better name. Complete implementation.

    used in IBEIS setters

    accepts_scalar_input2 is a decorator which expects to be used on class
    methods.  It lets the user pass either a vector or a scalar to a function,
    as long as the function treats everything like a vector. Input and output
    is sanitized to the user expected format on return.

    Args:
        argx_list (list): indexes of args that could be passed in as scalars to
            code that operates on lists. Ensures that decorated function gets
            the argument as an iterable.