def is_generator(val):
return isinstance(val, types.GeneratorType)<EOL>
Checks whether a variable is a generator.

Parameters
----------
val
    The variable to check.

Returns
-------
bool
    True is the variable is a generator. Otherwise False.