def process_none_or_boolean_option_tray(widget_kwargs, type_):
    """Check whether given args can define option tray.

    Also performs additional changes in the widget kwargs
    received if the check does confirm the arguments can
    be used to infer what is missing.

    That is, we check whether the default value and type
    associated with a parameter are compliant with what is
    expected to define an option tray widget with
    False/None/True as its options.

    If get to the end of this function without raising any
    exceptions, it means the data received is approved
    for defining such widget, so we add what is missing,
    so the keyword arguments are ready to instantiate the
    widget when needed.

    Parameters
    ==========
    widget_kwargs (dict)
        a dict whose sole item is the 'value' key
        pointing to any object.
    type_ (any Python value)
        the type associated with the parameter.
    """
    ### retrieve the value
    value = widget_kwargs["value"]

    ### if type is bool and value is None raise no error,
    ### we do nothing, since this is an allowed scenario
    if type_ is bool and value is None:
        pass

    ### otherwise, we keep performing extra checks, this
    ### time for forbidden scenarios, assuming type_ is an
    ### iterable (if it is not, the TypeError raised by
    ### len() is purposefully not caught, meaning the check
    ### failed; it might be better to catch the exception
    ### and raise another one with a better explanation,
    ### though)

    elif len(type_) != 2:

        raise TypeError(
            "if type is an iterable, it must have only 02"
            " items, regardless of the order, for"
            " 'False/None/True' option tray to be defined"
        )

    elif bool not in type_:

        raise TypeError(
            "bool must be in 'type_' iterable for"
            " 'False/None/True' option tray to be defined"
        )

    elif None not in type_ and type(None) not in type_:

        raise TypeError(
            "either None or NoneType must be in 'type_'"
            " iterable for 'False/None/True' option tray"
            " to be defined"
        )

        ## note: since we avoided the previous
        ## "if/elif blocks" we can be sure that type_ has
        ## 02 items and bool is one of them; in addition
        ## to this, if we avoid this "elif block" as well,
        ## we can be sure that the other element is either
        ## None or type(None); in other words, both None
        ## and type(None) cannot appear at the same time
        ## in type_

    elif not isinstance(widget_kwargs["value"], (type(None), bool)):

        raise ValueError(
            "'value' must be either None, True or False"
            " for 'False/None/True' option tray to be"
            " defined"
        )

    ### getting to this point in the function means
    ### the data can be used to define the False/None/True
    ### option tray, but it isn't complete yet, so we
    ### increment the widget kwargs with what it is
    ### lacking: the 'options' argument
    widget_kwargs["options"] = [False, None, True]
Check whether given args can define option tray.

    Also performs additional changes in the widget kwargs
    received if the check does confirm the arguments can
    be used to infer what is missing.

    That is, we check whether the default value and type
    associated with a parameter are compliant with what is
    expected to define an option tray widget with
    False/None/True as its options.

    If get to the end of this function without raising any
    exceptions, it means the data received is approved
    for defining such widget, so we add what is missing,
    so the keyword arguments are ready to instantiate the
    widget when needed.

    Parameters
    ==========
    widget_kwargs (dict)
        a dict whose sole item is the 'value' key
        pointing to any object.
    type_ (any Python value)
        the type associated with the parameter.
    
nodezator/graphman/widget/utils.py