def get_item(dictionary, tuple_key, default_value):
    """Grab values from a dictionary using an unordered tuple as a key.

    Dictionary should not contain None, 0, or False as dictionary values.

    Args:
        dictionary: Dictionary that uses two-element tuple as keys
        tuple_key: Unordered tuple of two elements
        default_value: Value that is returned when the tuple_key is not found in the dictionary
    """
    u, v = tuple_key

    # Grab tuple-values from dictionary
    tuple1 = dictionary.get((u, v), None)
    tuple2 = dictionary.get((v, u), None)

    # Return the first value that is not {None, 0, False}
    return tuple1 or tuple2 or default_value
def get_item ( dictionary , tuple_key , default_value ) : u , v = tuple_key tuple1 = dictionary . get ( ( u , v ) , None ) tuple2 = dictionary . get ( ( v , u ) , None ) return tuple1 or tuple2 or default_value
Grab values from a dictionary using an unordered tuple as a key.

    Dictionary should not contain None, 0, or False as dictionary values.

    Args:
        dictionary: Dictionary that uses two-element tuple as keys
        tuple_key: Unordered tuple of two elements
        default_value: Value that is returned when the tuple_key is not found in the dictionary