def degenerate(enumerable):
if (isinstance(enumerable, xrange) or<EOL>inspect.isgeneratorfunction(enumerable) or<EOL>inspect.isgenerator(enumerable)):<EOL><INDENT>return list(enumerable)<EOL><DEDENT>return enumerable<EOL>
Converts generators to lists

degenerate(xrange(2))
# => [0, 1]