(
    *args: Union[ElementType, ChoiceSweep, RangeSweep],
    sweep: Optional[Union[ChoiceSweep, RangeSweep]] = None,
    list: Optional[List[Any]] = None,
)
Shuffle input list or sweep (does not support interval)
Shuffle input list or sweep (does not support interval)
Shuffle input list or sweep ( does not support interval )
def shuffle(
    *args: Union[ElementType, ChoiceSweep, RangeSweep],
    sweep: Optional[Union[ChoiceSweep, RangeSweep]] = None,
    list: Optional[List[Any]] = None,
) -> Union[List[Any], ChoiceSweep, RangeSweep]:
    """
    Shuffle input list or sweep (does not support interval)
    """
    if list is not None:
        return shuffle(list)
    if sweep is not None:
        return shuffle(sweep)

    if len(args) == 1:
        arg = args[0]
        if isinstance(arg, (ChoiceSweep, RangeSweep)):
            sweep = copy(arg)
            sweep.shuffle = True
            return sweep
        if isinstance(arg, builtins.list):
            lst = copy(arg)
            random.shuffle(lst)
            return lst
        else:
            return [arg]
    else:
        simple_choice = _list_to_simple_choice(*args)
        simple_choice.shuffle = True
        return simple_choice
def shuffle ( * args : Union [ ElementType , ChoiceSweep , RangeSweep ] , sweep : Optional [ Union [ ChoiceSweep , RangeSweep ] ] = None , list : Optional [ List [ Any ] ] = None , ) -> Union [ List [ Any ] , ChoiceSweep , RangeSweep ] : if list is not None : return shuffle ( list ) if sweep is not None : return shuffle ( sweep ) if len ( args ) == 1 : arg = args [ 0 ] if isinstance ( arg , ( ChoiceSweep , RangeSweep ) ) : sweep = copy ( arg ) sweep . shuffle = True return sweep if isinstance ( arg , builtins . list ) : lst = copy ( arg ) random . shuffle ( lst ) return lst else : return [ arg ] else : simple_choice = _list_to_simple_choice ( * args ) simple_choice . shuffle = True return simple_choice