Problem importing another class

Hi, I’m trying to import a class into another class and I get an error like that

 UsersStatistics.group_users_by_fingerprint(self, new=True)
NameError: name 'self' is not defined

My first class where I import the class

 UsersStatistics.group_users_by_fingerprint(self, new=True)

UsersStatistic class

class UsersStatistics:
    
    def __init__(self, requester):
        self.requester = requester
        self.previous_statistics_timestamp = None
        self.stored_statistics_found = False
        self.previous_statistics = None
        self.statistics_generated_at = datetime.now()

    def group_users_by_fingerprint(self, new=True):
        grouped_by_fingerprint = {}
        if new:
            sessions = WMSession.objects.filter(added__gt=self.previous_statistics_timestamp,
                                                owner_account=self.requester)
        else:
            sessions = WMSession.objects.filter(added__lt=self.previous_statistics_timestamp,
                                                owner_account=self.requester)
        users = WMUser.objects.filter(owner_account=self.requester, wmsession__in=sessions)
        for user in users:
            try:
                user_fingerprint = user.data['fingerprint']
                if user_fingerprint in grouped_by_fingerprint:
                    grouped_by_fingerprint[user_fingerprint].append(user)
                else:
                    grouped_by_fingerprint[user_fingerprint] = [user]
            except:
                continue

        return grouped_by_fingerprint

We would need to see the files where you’re doing the imports and the classes, functions, or methods containing those two statements.

I guess you don’t need to add self in Class Calling, and it will be only argument when calling the class like this

UsersStatistics.group_users_by_fingerprint(new=True)

if not solved, please provide more code as KenWhitesell mentioned above.