class_docstr: Encode the string to utf-8 bytes.
docstr: Encode the string to utf-8 bytes.
  
  Args:
      data (object): Data to be serialized.
  Returns:
      raw-bytes: The data serialized as raw-bytes from the input.
docstr_tok: ["Encode","the","string","to","utf-8","bytes",".","Args",":","data","(","object",")",":","Data","to","be","serialized",".","Returns",":","raw-bytes",":","The","data","serialized","as","raw-bytes","from","the","input","."]
code: def serialize(self, data):
      """Encode the string to utf-8 bytes.
  
      Args:
          data (object): Data to be serialized.
      Returns:
          raw-bytes: The data serialized as raw-bytes from the input.
      """
  
      if isinstance(data, str):
          return data.encode("utf-8")
  
      raise ValueError(
          f"Object of type {type(data)} is not String serializable."
      )
  
imports: from __future__ import absolute_import
  import abc
  from collections.abc import Iterable
  import csv
  import io
  import json
  import numpy
  from pandas import DataFrame
  from six import with_metaclass
  from sagemaker.utils import DeferredError
label_desc: Use image node_id 2 for calling the StringSerializer obj's underlying member method code with example usage: obj.serialize(data) and returns: data