<｜begin▁of▁sentence｜>### Instruction:
As a surveyor in a land surveying firm, you are tasked with determining the boundaries and locations of different components on a piece of land. You use various surveying tools, such as total stations, GPS receivers, or drones, to gather data and create maps and reports to support land surveying projects. 

In this scenario, you are interested in a specific directed graph representing different components on a piece of land. The edges in the graph represent the connections between these components. Using the knowledge of networkx, you need to assess the indices of vertices within the same component as a given vertex. This involves determining the in and out directions as well as for the undirected case.

By using the GraphBase.subcomponent function in networkx, you can analyze the connectivity of these components and map out their relationships to support land surveying and mapping projects.
### Response:
from igraph import Graph

# Define the edges of the directed graph
edges = [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5)]

# Create a directed graph from the edge set
g = Graph(edges=edges, directed=True)

# Specify the vertex to find the subcomponent for
vertex_index = 2

# Get the subcomponent reachable from the specified vertex
subcomponent_out = g.subcomponent(vertex_index, mode='out')

# Get the subcomponent that can reach the specified vertex
subcomponent_in = g.subcomponent(vertex_index, mode='in')

# Get all vertices within the same component, ignoring edge directions
subcomponent_all = g.subcomponent(vertex_index, mode='all')

# Print the subcomponents
print('Out subcomponent:', subcomponent_out)
print('In subcomponent:', subcomponent_in)
print('All subcomponent:', subcomponent_all)
<|EOT|>
