def _choose_tagged_tests(tests, tags):
    """
    Select tests that are tagged with at least one of the given tags.
    """
    selected = []
    tags = set(tags)
    for test in _flatten_suite(tests):
        assert isinstance(test, unittest.TestCase)
        func = getattr(test, test._testMethodName)
        try:
            # Look up the method's underlying function (Python 2)
            func = func.im_func
        except AttributeError:
            pass
        try:
            if func.tags & tags:
                selected.append(test)
        except __HOLE__:
            # Test method doesn't have any tags
            pass
    return unittest.TestSuite(selected)
dataset/ETHPy150Open numba/numba/numba/testing/main.py/_choose_tagged_tests