code: def serialize_base64(attr, **kwargs):
          
          encoded = b64encode(attr).decode('ascii')
          return encoded.strip('=').replace('+', '-').replace('/', '_')
docs: Serialize str into base-64 string.
  
          :param attr: Object to be serialized.
          :rtype: str