<｜begin▁of▁sentence｜>### Instruction:
As a Health Inspector, imagine you're analyzing a network model representing a local food distribution system. The system is composed of two distinct groups: the first group represents local food suppliers, labeled as ['A', 'B', 'C', 'D'], and the second group signifies the public facilities they supply, numbered [1, 2, 3, 4]. Relationships between the two are akin to supply routes, with current connections represented by the pairs [('A', 1), ('B', 2), ('C', 3), ('D', 4)]. For regulatory compliance, you need to categorize the suppliers and facilities into their respective clusters within this network diagram, ensuring clear demarcation. How would you employ NetworkX to accurately assign the nodes to their corresponding groups, given this setup?
### Response:
import networkx as nx
from networkx.algorithms import bipartite

# Create a bipartite graph
B = nx.Graph()
# Add nodes with the node attribute 'bipartite'
B.add_nodes_from(['A', 'B', 'C', 'D'], bipartite=0)
B.add_nodes_from([1, 2, 3, 4], bipartite=1)
# Add edges only between nodes of opposite node sets
B.add_edges_from([('A', 1), ('B', 2), ('C', 3), ('D', 4)])

# Get the sets of nodes
X, Y = bipartite.sets(B)

print('Set X:', set(X))
print('Set Y:', set(Y))
<|EOT|>
