<｜begin▁of▁sentence｜>### Instruction:
As a forester, imagine you're responsible for a large forest with three types of trees: oak, pine, and maple. You have carefully marked pairs of trees that are beneficial to each other's growth, such as oak-pine and oak-maple pairs. Using a software tool like NetworkX, you can create a map of these tree pairings and their connections. Now, let's say you want to check if a specific tree is part of a mutually beneficial pairing (perfect matching). The challenge is to determine if a selected oak tree, for instance, is part of a perfect pairing with either pine or maple trees based on the existing network of connections.
### Response:
from networkx.algorithms.matching import is_perfect_matching
import networkx as nx

# Create a sample bipartite graph
B = nx.Graph()
B.add_edges_from([(1, 2), (1, 3), (2, 3)])

# Define a matching
matching = {1: 2, 3: 1}

# Check if a given node is matched
node = 1
is_node_matched = is_perfect_matching(B, matching)

print(f'Is node {node} matched? {is_node_matched}')
<|EOT|>
