Convert an object to JSON, via the defaults set with register_json_default.

  :obj: the object to convert

def json_default(obj):
  """Convert an object to JSON, via the defaults set with register_json_default.

  :obj: the object to convert
  """
  for default in _JSON_DEFAULTS:
    if default[0](obj):
      return default[1](obj)
  raise TypeError(repr(obj) + " is not JSON serializable")