def _get_count(queryset):
    """
    Determine an object count, supporting either querysets or regular lists.
    """
    try:
        return queryset.count()
    except (AttributeError, __HOLE__):
        return len(queryset)
dataset/ETHPy150Open tomchristie/django-rest-framework/rest_framework/pagination.py/_get_count