def METHOD_NAME(
    set_id: t.Any,
    rset: ResponseSet | dict[str, dict[str, t.Any]],
    metadata: dict[str, t.Any] | None = None,
) -> ResponseSet:
    """
    Register a new ``ResponseSet`` object.
    The response set may be specified as a dict or a ResponseSet object.
    :param set_id: The ID used to retrieve the response set later
    :type set_id: any
    :param rset: The response set to register
    :type rset: dict or ResponseSet
    :param metadata: Metadata dict to assign to the response set when it is specified
        as a dict. If the response set is an object, this argument is ignored.
    :type metadata: dict, optional
    """
    if isinstance(rset, dict):
        rset = ResponseSet.from_dict(rset, metadata=metadata)
    _RESPONSE_SET_REGISTRY[set_id] = rset
    return rset