<｜begin▁of▁sentence｜>### Instruction:
As a public health educator, you may come across the need to assess the diversity of resources available in different community centers to ensure equitable access to health services. Imagine you are tasked with evaluating the diversity of services available at various community health centers. To quantify this, you will need to use the Vertex.diversity function in igraph to calculate the diversity of resources at a specific community health center, represented as a network of interconnected services with associated weights.
### Response:
import igraph as ig

# Create an undirected graph with 9 vertices
edges = [(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3), (4, 5), (5, 6), (6, 7), (7, 8), (8, 4)]
weights = [2, 1, 1, 3, 4, 1, 1, 1, 1, 1, 1]
g = ig.Graph(edges=edges, directed=False)
g.es['weight'] = weights  # Assign weights to edges

# Calculate diversity for a specific vertex, e.g., vertex 0
diversity_value = g.vs[0].diversity(weights='weight')
print('Diversity of vertex 0:', diversity_value)
<|EOT|>
