@classmethod
    def active(cls, group=None, delta=datetime.timedelta(minutes=1)):
        # Get all the active streaming severs for this channel
        lastseen_after = datetime.datetime.now() - delta
        q = cls.objects.filter(lastseen__gte=lastseen_after).order_by(
            'group', 'ip', '-lastseen'
            )
        if group:
            q = q.filter(group__exact=group)

        # distinct_support = True
        try:
            qd = q.distinct('group', 'ip')
            return list(qd)
        except NotImplementedError:
            distinct_endpoints = {}
            for endpoint in q:
                key = (endpoint.group, endpoint.ip)

                if key not in distinct_endpoints:
                    distinct_endpoints[key] = endpoint

            return list(distinct_endpoints.values())
Check if a string is None or ''
dataset/ETHPy150Open timvideos/streaming-system/website/tracker/models.py/Endpoint.active--crossover with--dataset/ETHPy150Open sebdah/scrapy-mongodb/scrapy_mongodb.py/not_set