@property
def modularity(self):
    'Returns the modularity score'
    if self._modularity_dirty:
        return self._recalculate_modularity_safe()
    return self._modularity
Returns the modularity score
@property
def modularity(self):
    
    if self._modularity_dirty:
        return self._recalculate_modularity_safe()
    return self._modularity