<｜begin▁of▁sentence｜>### Instruction:
Suppose we have partitioned the Karate Club graph into different communities using the Leiden algorithm, and we want to create a HierarchicalCluster instance for a specific node. Given the node with id 0, which belongs to a certain Leiden cluster without any parent clusters, how can we instantiate the HierarchicalCluster with hierarchical clustering attributes including its level and whether it's a terminal cluster?
### Response:
import numpy as np
import networkx as nx
from graspologic.partition import leiden, HierarchicalCluster

# Create an example graph
g = nx.karate_club_graph()
# Partition the graph into communities using the leiden algorithm
partition = leiden(g)

# Create a hierarchical cluster for the node with id 0
hc = HierarchicalCluster(node=0, cluster=partition[0], parent_cluster=None, level=0, is_final_cluster=True)

# Get attributes from the hierarchical cluster object
node_id = hc.node
cluster_id = hc.cluster
parent_cluster_id = hc.parent_cluster
level = hc.level
is_final = hc.is_final_cluster

print(f'Node: {node_id}, Cluster: {cluster_id}, Parent Cluster: {parent_cluster_id}, Level: {level}, Is Final Cluster: {is_final}')
<|EOT|>
