def METHOD_NAME(self, gid):
    q = """select count(*) from GROUPS, CLIENTS where
           GROUPS.clientid = CLIENTS.clientid and
           CLIENTS.active = 1 and
           GROUPS.groupid = %s"""
    self.c.execute(q, (gid,))
    ret = self.c.fetchone()
    return ret[0]