<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def translate(self, exc):
 """Return translation of exception to new class. Calling code should only raise exception if exception class is passed in, else ``None`` (which signifies no wrapping should be done). """

        # Find actual class.
        for key in self.translations.keys():
            if isinstance(exc, key):
                # pylint: disable=unsubscriptable-object
                return self.translations[key](str(exc))

        return None