from typing import Iterable
from typing import Union
from typing import List
from typing import Generator


def make_single_arguments(iterable_of_args: Iterable, generator: bool = True) -> Union[List, Generator]:
    """
    Converts an iterable of single arguments to an iterable of single argument tuples

    :param iterable_of_args: A numpy array or an iterable containing tuples of arguments to pass to a worker, which
        passes it to the function
    :param generator: Whether or not to return a generator, otherwise a materialized list will be returned
    :return: Iterable of single argument tuples
    """
    gen = ((arg,) for arg in iterable_of_args)
    return gen if generator else list(gen)