<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def numRegisteredForRole(self, role, includeTemporaryRegs=False):
        '''
        Accepts a DanceRole object and returns the number of registrations of that role.
        '''
        count = self.eventregistration_set.filter(cancelled=False,dropIn=False,role=role).count()
        if includeTemporaryRegs:
            count += self.temporaryeventregistration_set.filter(dropIn=False,role=role).exclude(
                registration__expirationDate__lte=timezone.now()).count()
        return count