<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph in 'sample.gml', can you check if the graph is strongly and weakly connected using the is_connected function from igraph? And can you print whether the graph is strongly or weakly connected?
### Response:
import igraph as ig

# Read the graph from file
graph = ig.read('sample.gml')

# Check if the graph is strongly connected
is_strongly_connected = graph.is_connected(mode=ig.STRONG)

# Check if the graph is weakly connected
is_weakly_connected = graph.is_connected(mode=ig.WEAK)

print('Strongly connected:', is_strongly_connected)
print('Weakly connected:', is_weakly_connected)
<|EOT|>
