def METHOD_NAME(
    self, generator: Iterator[Any]
) -> None:
    """
    Sets the traffic pattern defined by generator argument.
    :param generator: A python generator object that creates traffic
    patterns through calls to methods of PyTrafficGen.
    """
    for core in self.cores:
        core.METHOD_NAME(generator)