def union(*schedules: List[Union[ScheduleComponent, Tuple[int, ScheduleComponent]]],<EOL>name: str = None) -> Schedule:
if name is None and schedules:<EOL><INDENT>sched = schedules[<NUM_LIT:0>]<EOL>if isinstance(sched, (list, tuple)):<EOL><INDENT>name = sched[<NUM_LIT:1>].name<EOL><DEDENT>else:<EOL><INDENT>name = sched.name<EOL><DEDENT><DEDENT>return Schedule(*schedules, name=name)<EOL>
Create a union (and also shift if desired) of all input `Schedule`s.

    Args:
        *schedules: Schedules to take the union of
        name: Name of the new schedule. Defaults to first element of `schedules`