test_annos.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:deepcpg 作者: cangermueller 项目源码 文件源码
def test_in_which():
    f = annos.in_which
    ys = [2, 4, 12, 17]
    ye = [2, 8, 15, 18]

    x = []
    expect = []
    result = f(x, ys, ye)
    npt.assert_array_equal(result, expect)

    x = [-1, 3, 9, 19]
    expect = [-1, -1, -1, -1]
    result = f(x, ys, ye)
    npt.assert_array_equal(result, expect)

    x = [-1, 2, 2, 3, 4, 8, 15, 16]
    expect = [-1, 0, 0, -1, 1, 1, 2, -1]
    result = f(x, ys, ye)
    npt.assert_array_equal(result, expect)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号