def make_serializable_key(o):
    "\n    Recursively convert numpy types to native types for JSON serialization.\n\n    This function is for making serizializable dictionary keys, so no containers.\n    This function should NOT be passed into json.dump or json.dumps as the 'default' arg.\n\n    Parameters\n    ----------\n    o : object\n        The object to be converted.\n\n    Returns\n    -------\n    object\n        The converted object.\n    "
    if isinstance(o, str):
        return o
    elif isinstance(o, np.number):
        return o.item()
    elif hasattr(o, '__dict__'):
        return o.__class__.__name__
    else:
        return str(o)
Recursively convert numpy types to native types for JSON serialization.

This function is for making serizializable dictionary keys, so no containers.
This function should NOT be passed into json.dump or json.dumps as the 'default' arg.

Parameters
----------
o : object
    The object to be converted.

Returns
-------
object
    The converted object.
def make_serializable_key(o):
    "\n    Recursively convert numpy types to native types for JSON serialization.\n\n    This function is for making serizializable dictionary keys, so no containers.\n    This function should NOT be passed into json.dump or json.dumps as the 'default' arg.\n\n    Parameters\n    ----------\n    o : object\n        The object to be converted.\n\n    Returns\n    -------\n    object\n        The converted object.\n    "
    if isinstance(o, str):
        return o
    elif isinstance(o, np.number):
        return o.item()
    elif hasattr(o, '__dict__'):
        return o.__class__.__name__
    else:
        return str(o)