def contains_names(texnode, names):
    """
    Returns True if `texnode` (env or BraceGroup) contains one of the `names`.
    """
    verdict = False
    for name in names:
        if texnode.find(name):
            verdict = True
            break
    return verdict