<｜begin▁of▁sentence｜>### Instruction:
Given a graph with 3 vertices and each vertex has a 'label' and 'color' attribute, can you create a custom attribute collector to gather these attributes and then access the collected attributes of a specific vertex?
### Response:
from igraph import Graph

# Create a graph with 3 vertices and 3 edges
g = Graph([(0, 1), (1, 2), (2, 0)])

# Add some vertex attributes
g.vs['label'] = ['v1', 'v2', 'v3']
g.vs['color'] = ['red', 'green', 'blue']

# Define a custom attribute collector class
class MyAttributeCollector(ig.VertexSeq):
    # This collector will gather 'label' and 'color' attributes
    label = ig.attributes.CollectorAttribute()
    color = ig.attributes.CollectorAttribute()

# Initialize the attribute collector with the graph's vertex sequence
my_collector = MyAttributeCollector(g.vs)

# Access collected attributes of vertex at index 1
print(my_collector[1]['label'], my_collector[1]['color'])

# Get the length of the collector (number of collected elements)
print(len(my_collector))
<|EOT|>
