def validate_value_and_options(self, value, options):
        """Check whether value and options are valid.

        Parameters
        ==========
        value, options
            same as defined in __init__() method.
        """
        ### raise an error immediately if the value isn't
        ### within the possible values

        if value not in options:
            raise ValueError("'value' must be listed in 'options'")

        ### raise type error if values aren't python
        ### literals

        if any(not isliteral(item) for item in options):

            raise TypeError("each item in 'options' must be a" " python literal")

        ### raise value error if any value is the same/equal
        ### as any other existing value

        if any(a is b or a == b for a, b in combinations(options, 2)):

            raise ValueError(
                "'options' can't have items which are"
                " identical or equal to one another"
            )
Check whether value and options are valid.

        Parameters
        ==========
        value, options
            same as defined in __init__() method.
        
nodezator/widget/optionmenu/main.py