def check_generator_arguments(y=None, sample_weight=None, validation_split=None
    ):
    """Validates arguments passed when using a generator."""
    if y is not None:
        raise ValueError(
            '`y` argument is not supported when data isa generator or Sequence instance. Instead pass targets as the second element of the generator.'
            )
    if sample_weight is not None:
        raise ValueError(
            '`sample_weight` argument is not supported when data isa generator or Sequence instance. Instead pass sample weights as the third element of the generator.'
            )
    if validation_split:
        raise ValueError(
            'If your data is in the form of a Python generator, you cannot use `validation_split`.'
            )
