<｜begin▁of▁sentence｜>### Instruction:
As a psychiatrist, you're familiar with the intricate nature of understanding and navigating the human mind. Imagine you're assessing a patient's social network dynamics, akin to exploring the connections in their mind. Consider a scenario where you're examining the interactions within a friend group. You have a list of friendships represented as edges: [(John, Mary), (Mary, Tom), (Tom, Sarah), (Sarah, Emily)]. Now, you're interested in understanding how far-reaching the influence of Mary is within the group. How would you utilize the "neighborhood_size" function in igraph, an analytical tool akin to evaluating the number of individuals reachable from Mary within a maximum of 2 social connections?
### Response:
import igraph as ig

# Create a sample graph
g = ig.Graph(edges=[(0, 1), (1, 2), (2, 3), (3, 4)], directed=False)

# Calculate the neighborhood size for vertex 1 within a maximum distance (order) of 2
neighborhood_sizes = g.neighborhood_size(vertices=[1], order=2)

# Print the neighborhood size for vertex 1
print(neighborhood_sizes)
<|EOT|>
