def get_lattice_points(tup1, tup2, check_diagonals = True):
    """Returns a list of points which lie in a line defined by two endpoints"""
    x1, y1 = tup1[0], tup1[1]
    x2, y2 = tup2[0], tup2[1]
    # for horizontal lines, y values are same
    if y1 == y2:
        if x1 <= x2:
            points = [(i, y1) for i in range(x1, x2 + 1)]
            return points
        else:
            points = [(i, y1) for i in range(x2, x1 + 1)]
            return points
    # for vertical points, x values are same
    elif x1 == x2:
        if y1 <= y2:
            points = [(x1, i) for i in range(y1, y2 + 1)]
            return points
        else:
            points = [(x1, i) for i in range(y2, y1 + 1)]
            return points
    elif check_diagonals:
    # diagonal lines
        slope = (y2-y1)/(x2-x1)
        y_int = y1 - slope*x1
        # getting the poitns
        if x1 <= x2:
            points = [(i, int(slope * i + y_int)) for i in range(x1, x2 + 1) if (slope * i + y_int).is_integer()]
            return points
        else:
            points = [(i, int(slope * i + y_int)) for i in range(x2, x1 + 1) if (slope * i + y_int).is_integer()]
            return points