(*args)
return tuple(ret_args)
Unpack the list with only one element.
Unpack the list with only one element.
Unpack the list with only one element .
def unpack(*args):
    """Unpack the list with only one element.
    

    """
    ret_args = []
    for arg in args:
        if isinstance(arg, (list, np.ndarray, BaseCollection)):
            if len(arg) == 1:
                ret_args.append(arg[0])
            else:
                ret_args.append(arg)
        else:
            ret_args.append(arg)
    return tuple(ret_args)
def unpack ( * args ) : ret_args = [ ] for arg in args : if isinstance ( arg , ( list , np . ndarray , BaseCollection ) ) : if len ( arg ) == 1 : ret_args . append ( arg [ 0 ] ) else : ret_args . append ( arg ) else : ret_args . append ( arg ) return tuple ( ret_args )