from typing import Union
from typing import Any
from typing import List
from typing import Tuple


def get_sched_value(value_schedule: Union[Any, List[Tuple[Any, int]]], epoch_number: int) -> Any:
    """Get a value that can be scheduled to change based on the epoch number.
    value_schedule is either a scalar value or a list of tuples [(epochs, value1), (epochs, value2), ...]"""
    if not isinstance(value_schedule, list):
        return value_schedule
    else:
        epoch_sum = 0

        for v in value_schedule:
            epoch_sum += v[0]

            if epoch_number <= epoch_sum:
                return v[1]

        return value_schedule[-1][1]