Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

src/a/z/AZOrange-HEAD/orange/OrangeWidgets/Data/OWAddClass.py   AZOrange(Download)
            self.warning(0,'Invalid values list. Usage: ["A","B","C"]')
        #self.newName = self.newName.upper()
        newTable = dataUtilities.addDiscreteClass(self.data, self.newName,self.value,values)
        if not newTable:
            self.error(0,'It was not possible to add the attribute the way you specified. Please check again the options!')

src/a/z/AZOrange-HEAD/tests/source/AZdataUtilitiesTest.py   AZOrange(Download)
    def test_AddDiscreteClass(self):
        """Tes the add discrete class"""
        newData = dataUtilities.addDiscreteClass(self.testData,"Class_Test","Val_1",["Val_2","Val_3"])
        self.assertEqual(len(self.testData.domain)+1,len(newData.domain),"Domain len not correct")
        self.assertEqual(newData.domain.classVar.name,"Class_Test","Wrong Class var")