def saveValues(self, **kwargs):
        # Check that we have all the "columns"
        if len(kwargs) != len(self.columnNames) and self.showWarningWhenIncompleteColumns:
            print("WARNING. There is a wrong number of arguments in ReportsWidget. ")
            print("Current columns: ")
            pprint.pprint(self.columnNames)
            print("Total: {0}".format(len(self.columnNames)))
            print("Args passed: ")
            pprint.pprint(kwargs)
            print("Total: {0}".format(len(kwargs)))

        for key in kwargs:
            if key not in self.columnNames:
                print("WARNING: Column {0} is not included in the list of columns".format(key))
        # Add the values in the right order (there are not obligatory fields)
        orderedColumns = []
        # Always add a timestamp as the first value
        orderedColumns.append(time.strftime("%Y/%m/%d %H:%M:%S"))
        for column in self.columnNames:
            if kwargs.has_key(column):
                orderedColumns.append(kwargs[column])
            else:
                orderedColumns.append('')

        fileExists = os.path.isfile(self.csvFilePath)
        with open(self.csvFilePath, 'a+b') as csvfile:
            writer = csv.writer(csvfile)
            # If file is empty, save also the column names
            # if not fileExists:
            #     writer.writerow(self.columnNames)
            writer.writerow(orderedColumns)
Setups toolbox object and authorization mechanism based
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/CIP_Common/CIP/ui/CaseReportsWidget.py/CaseReportsLogic.saveValues--crossover with--dataset/ETHPy150Open galaxyproject/pulsar/pulsar/core.py/PulsarApp.__setup_tool_config