def enclosing_scope(scope):
 return scope.rpartition(u'.')[0]

def enclosing_scope ( scope ) : return scope . rpartition ( u'.' ) [ 0 ]
utility function to return the scope immediately enclosing a given scope .