<｜begin▁of▁sentence｜>### Instruction:
As a Telecommunications Technician, you have been tasked with analyzing the co-authorship network of scientific papers. The network is stored in a GML file named netscience.gml. Your goal is to use the kcut algorithm from the cdlib library to identify communities within the network, with a maximum of 4 communities. Once the community detection is completed, you are required to present the list of nodes for each detected community.
### Response:
from cdlib import algorithms
import networkx as nx

# Load the network science co-authorship graph
data_path = 'netscience.gml'
G = nx.read_gml(data_path)

# Apply kcut community detection algorithm
communities = algorithms.kcut(G, kmax=4)

# Print the communities detected
each_community = [list(community) for community in communities.communities]
print("Detected communities:", each_community)
<|EOT|>
