code: def uuid2buid(value):
      
      if six.PY3:  # pragma: no cover
          return urlsafe_b64encode(value.bytes).decode('utf-8').rstrip('=')
      else:
          return six.text_type(urlsafe_b64encode(value.bytes).rstrip('='))
docs: Convert a UUID object to a 22-char BUID string
  
      >>> u = uuid.UUID('33203dd2-f2ef-422f-aeb0-058d6f5f7089')
      >>> uuid2buid(u)
      'MyA90vLvQi-usAWNb19wiQ'