code: def username_to_uuid(username):
      
      if not username.startswith('u-') or len(username) != 28:
          raise ValueError('Not an UUID based username: %r' % (username,))
      decoded = base64.b32decode(username[2:].upper() + '======')
      return UUID(bytes=decoded)
docs: Convert username to UUID.
  
      >>> username_to_uuid('u-ad52zgilvnpgnduefzlh5jgr6y')
      UUID('00fbac99-0bab-5e66-8e84-2e567ea4d1f6')