<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dumps(o, **kwargs):
 """Dumps JSON object."""


    try:
        return _engine[1](o)

    except:
        ExceptionClass, why = sys.exc_info()[:2]

        if any([(issubclass(ExceptionClass, e)) for e in _engine[2]]):
            raise JSONError(why)
        else:
            raise why