class_docstr: This interface describes the methods that are required for a data type to be handled by the
  Flink runtime. Specifically, this interface contains the serialization and deserialization
  methods.
class_docstr_tok: ["This","interface","describes","the","methods","that","are","required","for","a","data","type","to","be","handled","by","the","Flink","runtime",".","Specifically",",","this","interface","contains","the","serialization","and","deserialization","methods","."]
code: def _get_coder(self):
      serialize_func = self.serialize
      deserialize_func = self.deserialize
  
      class CoderAdapter(object):
          def get_impl(self):
              return CoderAdapterIml()
  
      class CoderAdapterIml(object):
          def encode_nested(self, element):
              bytes_io = BytesIO()
              serialize_func(element, bytes_io)
              return bytes_io.getvalue()
  
          def decode_nested(self, bytes_data):
              bytes_io = BytesIO(bytes_data)
              return deserialize_func(bytes_io)
  
      return CoderAdapter()
  
file_path: flink/flink-python/pyflink/common/serializer.py
imports: from abc import abstractmethod, ABC
  from io import BytesIO
  from typing import TypeVar, Generic
label_desc: Use image node_id 7 for calling the TypeSerializer obj's underlying member method code with example usage: obj._get_coder() and returns: CoderAdapter, CoderAdapterIml, bytes_io, deserialize_func