human
I wrote the below code

    def _user_or_ip(request):
        if (hasattr(request, 'user') and request.user.is_authenticated()):
            key = str(request.user.pk)
        else:
            key = request.META.get('HTTP_X_CLUSTER_CLIENT_IP', request.META['REMOTE_ADDR'])
        return ('uip:%s:%s' % (key_prefix, key))
    return _user_or_ip

What's a good function header?
assistant
#Here's a good function header.

def user_or_ip(key_prefix):