def _rolesFromNames(self, cu, roleList):
        if not roleList:
            return {}
        where = []
        args = []
        if '*' in roleList:
            where.append('true')
        else:
            ids = set([x for x in roleList if isinstance(x, int)])
            names = set([x for x in roleList if not isinstance(x, int)])
            if ids:
                places = ', '.join('?' for x in ids)
                where.append('userGroupId IN ( %s )' % (places,))
                args.extend(ids)
            if names:
                places = ', '.join('?' for x in names)
                where.append('userGroup IN ( %s )' % (places,))
                args.extend(names)
        if not where:
            return {}
        where = ' OR '.join(where)
        query = ("SELECT userGroupId, accept_flags FROM UserGroups"
                " WHERE %s" % where)
        cu.execute(query, args)
        return dict((x[0], deps.ThawFlavor(x[1])) for x in cu)
dataset/ETHPy150Open sassoftware/conary/conary/repository/netrepos/netauth.py/UserAuthorization._rolesFromNames/original