def _lower(v):
if hasattr(v, "<STR_LIT>"):<EOL><INDENT>return v.lower()<EOL><DEDENT>if isinstance(v, (list, tuple)):<EOL><INDENT>return v.__class__(_lower(x) for x in v)<EOL><DEDENT>if isinstance(v, dict):<EOL><INDENT>return v.__class__(_lower(v.items()))<EOL><DEDENT>return v<EOL>
assumes that classes that inherit list, tuple or dict have a constructor
    that is compatible with those base classes. If you are using classes that
    don't satisfy this requirement you can subclass them and add a lower()
    method for the class