def _check_singleton_comparison(self, left_value, right_value, root_node, checking_for_absence: bool=False):
    'Check if == or != is being used to compare a singleton value'
    singleton_values = (True, False, None)

    def _is_singleton_const(node) -> bool:
        return (isinstance(node, astroid.Const) and any(((node.value is value) for value in singleton_values)))
    if _is_singleton_const(left_value):
        (singleton, other_value) = (left_value.value, right_value)
    elif _is_singleton_const(right_value):
        (singleton, other_value) = (right_value.value, left_value)
    else:
        return
    singleton_comparison_example = {False: "'{} is {}'", True: "'{} is not {}'"}
    if (singleton in (True, False)):
        suggestion_template = '{} if checking for the singleton value {}, or {} if testing for {}'
        truthiness_example = {False: 'not {}', True: '{}'}
        truthiness_phrase = {True: 'truthiness', False: 'falsiness'}
        checking_truthiness = (singleton is not checking_for_absence)
        suggestion = suggestion_template.format(singleton_comparison_example[checking_for_absence].format(left_value.as_string(), right_value.as_string()), singleton, ("'bool({})'" if ((not utils.is_test_condition(root_node)) and checking_truthiness) else "'{}'").format(truthiness_example[checking_truthiness].format(other_value.as_string())), truthiness_phrase[checking_truthiness])
    else:
        suggestion = singleton_comparison_example[checking_for_absence].format(left_value.as_string(), right_value.as_string())
    self.add_message('singleton-comparison', node=root_node, args=(f"'{root_node.as_string()}'", suggestion))
Check if == or != is being used to compare a singleton value
def _check_singleton_comparison(self, left_value, right_value, root_node, checking_for_absence: bool=False):
    
    singleton_values = (True, False, None)

    def _is_singleton_const(node) -> bool:
        return (isinstance(node, astroid.Const) and any(((node.value is value) for value in singleton_values)))
    if _is_singleton_const(left_value):
        (singleton, other_value) = (left_value.value, right_value)
    elif _is_singleton_const(right_value):
        (singleton, other_value) = (right_value.value, left_value)
    else:
        return
    singleton_comparison_example = {False: "'{} is {}'", True: "'{} is not {}'"}
    if (singleton in (True, False)):
        suggestion_template = '{} if checking for the singleton value {}, or {} if testing for {}'
        truthiness_example = {False: 'not {}', True: '{}'}
        truthiness_phrase = {True: 'truthiness', False: 'falsiness'}
        checking_truthiness = (singleton is not checking_for_absence)
        suggestion = suggestion_template.format(singleton_comparison_example[checking_for_absence].format(left_value.as_string(), right_value.as_string()), singleton, ("'bool({})'" if ((not utils.is_test_condition(root_node)) and checking_truthiness) else "'{}'").format(truthiness_example[checking_truthiness].format(other_value.as_string())), truthiness_phrase[checking_truthiness])
    else:
        suggestion = singleton_comparison_example[checking_for_absence].format(left_value.as_string(), right_value.as_string())
    self.add_message('singleton-comparison', node=root_node, args=(f"'{root_node.as_string()}'", suggestion))