def json_encode(obj, indent=None, sort_keys=False):
    """
    Wrapper function for encoding the provided object.

    This function automatically select appropriate JSON library based on the configuration value.

    This function should be used everywhere in the code base where json.dumps() behavior is desired.
    """
    json_library = DEFAULT_JSON_LIBRARY

    if json_library == "json":
        return json_encode_native_json(obj=obj, indent=indent, sort_keys=sort_keys)
    elif json_library == "orjson":
        return json_encode_orjson(obj=obj, indent=indent, sort_keys=sort_keys)
    else:
        raise ValueError("Unsupported json_library: %s" % (json_library))

    Wrapper function for encoding the provided object.

    This function automatically select appropriate JSON library based on the configuration value.

    This function should be used everywhere in the code base where json.dumps() behavior is desired.
    
st2common/st2common/util/jsonify.py