<｜begin▁of▁sentence｜>### Instruction:
Given two degree sequences aseq = [3, 2, 1] and bseq = [1, 1, 1, 1, 1, 1] for the two sets A and B respectively in a bipartite graph, can you create a bipartite graph using the Havel-Hakimi algorithm and then identify which bipartite set each node belongs to using NetworkX?
### Response:
import networkx as nx
from networkx.algorithms import bipartite

# Degree sequence for each set
aseq = [3, 2, 1]
bseq = [1, 1, 1, 1, 1, 1]

# Create a bipartite graph using Havel-Hakimi algorithm
G = bipartite.havel_hakimi_graph(aseq, bseq)

# Check if the graph is bipartite
is_bipartite = bipartite.is_bipartite(G)
print('Graph is bipartite:', is_bipartite)

# Show the nodes with their bipartite set attribute
for node, bipartite_set in bipartite.color(G).items():
  print(f'Node {node} is in bipartite set {bipartite_set}')
<|EOT|>
