def _contains_asexpr(node: Union[Node, Leaf]) -> bool:
    """Return True if `node` contains an as-pattern."""
    if node.type == syms.asexpr_test:
        return True
    elif node.type == syms.atom:
        if (
            len(node.children) == 3
            and node.children[0].type == token.LPAR
            and node.children[2].type == token.RPAR
        ):
            return _contains_asexpr(node.children[1])
    elif node.type == syms.testlist_gexp:
        return any(_contains_asexpr(child) for child in node.children)
    return False
Return True if `node` contains an as-pattern.
src/black/__init__.py