<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def viable_source_types_for_generator (generator):
 """ Caches the result of 'viable_source_types_for_generator'. """

    assert isinstance(generator, Generator)
    if generator not in __viable_source_types_cache:
        __vstg_cached_generators.append(generator)
        __viable_source_types_cache[generator] = viable_source_types_for_generator_real (generator)

    return __viable_source_types_cache[generator]