<｜begin▁of▁sentence｜>### Instruction:
Given an undirected graph specified by its edge list or loaded from a file, how can we use the community label propagation method in igraph to detect the community structures within the graph?
### Response:
import igraph as ig

# Load graph from a file or define it here
g = ig.Graph(edges=[(0, 1), (1, 2), (2, 3), (3, 0), (0, 2)])

# Find the communities
communities = g.community_label_propagation()

# Print the membership of each vertex
print(communities)

# If available, use a weight attribute for the edges
g.es['weight'] = [1, 2, 1, 1, 3]
weighted_communities = g.community_label_propagation(weights='weight')
print(weighted_communities)
<|EOT|>
