def METHOD_NAME(self, o):  # pylint: disable=method-hidden
    """Override default method for numpy types."""
    if isinstance(o, np.floating):
        return float(o)
    if isinstance(o, np.integer):
        return int(o)
    if isinstance(o, np.ndarray):
        return o.tolist()
    return json.JSONEncoder.METHOD_NAME(self, o)