code: def exists(self, name):
          
          with self.settings(hide('running', 'stdout', 'warnings'), warn_only=True):
              return self.run('getent group %(name)s' % locals()).succeeded
docs: Check if a group exists.