def get_contiguous_var(var_ind, is_left_right, is_bigger):
    """
    Gets the variable index that is either left, right, down or up of var_ind.
    To get left var index: is_left_right must be True and is_bigger False
    To get right var index: is_left right must be True and is_bigger True
    To get down var index: is_left_right must be False and is_bigger False
    To get up var index: is_left_right must be False and is_bigger True

    :return: the index of the contiguous variable
    """

    side_offset = is_left_right * (-1) ** (1+is_bigger)
    vertical_offset = (not is_left_right) * (-1) ** (1+is_bigger)

    contiguous_var = (var_ind[0] + side_offset, var_ind[1] + vertical_offset)
    return contiguous_var