def encode_uid(pk):
    try:
        from django.utils.http import urlsafe_base64_encode
        from django.utils.encoding import force_bytes
        return urlsafe_base64_encode(force_bytes(pk)).decode()
    except __HOLE__:
        from django.utils.http import int_to_base36
        return int_to_base36(pk)
dataset/ETHPy150Open sunscrapers/djoser/djoser/utils.py/encode_uid