NetworkX provides several community detection algorithms. There are many ways to define communities, and many ways to search for them. However, in general, the NetworkX community detection functions take a Graph object and return a list or iterator over communities, represented as a set of node IDs.
The simplest type of community detection searches for non-overlapping communities. In other words, a network is partitioned into communities such that each node belongs to exactly one community.