06e423b08766d831d903cf4422d2c46735dd7821,data/rating.py,RatingDAO,contains,#RatingDAO#Any#Any#,144

Before Change



    def contains(self,u,i):
        "whether user u rated item i"
        return self.trainingMatrix.contains(self.getUserId(u),self.getItemId(i))

    def containsUser(self,u):
        "whether user is in training set"
        return self.trainingMatrix.matrix_User.has_key(self.getUserId(u))

After Change



    def contains(self,u,i):
        "whether user u rated item i"
        if self.user.has_key(u) and self.trainSet_u[u].has_key(i):
            return True
        else:
            return False


    def containsUser(self,u):
        "whether user is in training set"
        if self.user.has_key(u):
            return True
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: Coder-Yu/RecQ
Commit Name: 06e423b08766d831d903cf4422d2c46735dd7821
Time: 2017-06-09
Author: yuyu2223@163.com
File Name: data/rating.py
Class Name: RatingDAO
Method Name: contains


Project Name: nilmtk/nilmtk
Commit Name: 6cef8784effbc8c496e9573cc9b02d8c32f9059e
Time: 2014-05-08
Author: jack-list@xlk.org.uk
File Name: nilmtk/appliance.py
Class Name: Appliance
Method Name: matches


Project Name: Coder-Yu/RecQ
Commit Name: 06e423b08766d831d903cf4422d2c46735dd7821
Time: 2017-06-09
Author: yuyu2223@163.com
File Name: data/rating.py
Class Name: RatingDAO
Method Name: containsItem


Project Name: Coder-Yu/RecQ
Commit Name: 06e423b08766d831d903cf4422d2c46735dd7821
Time: 2017-06-09
Author: yuyu2223@163.com
File Name: data/rating.py
Class Name: RatingDAO
Method Name: containsUser