<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def default(self, o):
 """ JSONEncoder default method that converts NumPy arrays and quantities objects to lists. """

        if isinstance(o, Q_):
            return o.magnitude
        elif isinstance(o, np.ndarray):
            return o.tolist()
        else:
            # raise TypeError if not serializable
            return super(SimKitJSONEncoder, self).default(o)