docs: def portable_b64encode(thing):
      """Wrap b64encode for Python 2 & 3"""
      if is_py3():
          try:
              some_bits = bytes(thing, 'utf-8')
          except TypeError:
              some_bits = thing
  
          return polite_string(b64encode(some_bits).decode('utf-8'))
  
      return polite_string(b64encode(thing))