def active(self, registered_only=True):
visitors = self.filter(<EOL>expiry_time__gt=timezone.now(),<EOL>end_time=None<EOL>)<EOL>if registered_only:<EOL><INDENT>visitors = visitors.filter(user__isnull=False)<EOL><DEDENT>return visitors<EOL>
Returns all active users, e.g. not logged and non-expired session.