def _executeQuery(self, command, args=None):
        """execute the provided command on the database.

        args are specified as a dictionary.  error checking on the
        results is performed here and the returned value is a list of
        lists with each list representing a row of the returned table.
        """
        try:
            argument_string = "&".join(["%s=%s" % (x, args[x]) for x in args])
            command_string = "&".join([command, argument_string])
        except __HOLE__:
            command_string = command

        query = "%s?cmd=%s" % (self.url, command_string)

        if len(query) > 2048:
            if "gene_list" in args:
                genes = args['gene_list'].split(",")

                if len(genes) < 2:
                    raise ValueError("Request too long")

                args['gene_list'] = ",".join(genes[(len(genes) / 2):])
                query1 = self._executeQuery(command, args)
                warnings = self.last_warnings

                args['gene_list'] = ",".join(genes[:(len(genes) / 2)])
                query2 = self._executeQuery(command, args)
                self.last_warnings = warnings + self.last_warnings

                return query1 + query2

        data = urllib2.urlopen(query)

        line = data.readline()
        self.last_query = query
        self.last_status = line
        self.last_warnings = []
        self.last_header = [self.last_status]
        return_table = []

        while re.match("^#", line):

            if re.match("^# Warning: (.+)", line):
                self.last_warnings.append(
                    re.match("^# Warning: (.+)", line).groups(1)[0])
                self.last_header.append(line)
                line = data.readline()
                continue

            elif re.match("^#", line):
                self.last_header.append(line)
                line = data.readline()
                continue

        if re.match("^Error: (.+)", line):
            self.last_header.append(line)
            raise CDGSError(re.match("^Error: (.+)", line).groups(1)[0], query)
        line = line.strip()
        headers = line.split("\t")

        for line in data:
            if re.match("^# Warning: (.+)", line):
                self.last_warnings.append(
                    re.match("^# Warning: (.+)", line).groups(1)[0])
                self.last_header.append(line)
                line = data.readline()
                continue
            line = line.strip()
            return_table.append(odict(zip(headers, line.split("\t"))))

        return return_table
dataset/ETHPy150Open CGATOxford/cgat/CGAT/CBioPortal.py/CBioPortal._executeQuery