<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_subclasses(klass):
 """ Rather than statically import every interesting subclass, forcing it all to be transferred and potentially disrupting the debugged environment, enumerate only those loaded in memory. Also returns the original class. """

    stack = [klass]
    seen = set()
    while stack:
        klass = stack.pop()
        seen.add(klass)
        stack.extend(klass.__subclasses__())
    return seen