def assert_course(p0, p1, expected):
    try:
        len(expected)
        array = True
    except __HOLE__:
        array = False

    result = geog.course(p0, p1)
    if not array:
        with pytest.raises(TypeError):
            len(result)

    assert np.allclose(result, expected)

    result = geog.course(p0, p1, bearing=True)
    # Constrain between -180 and 180
    bearing = 90 - expected
    bearing = np.where(bearing > 180, bearing - 360, bearing)
    assert np.allclose(result, bearing)
dataset/ETHPy150Open jwass/geog/tests/test_course.py/assert_course