code: def serialize(cls, obj):
          
  
          cls._initialize()
          serializer = cls._get_serializer(type(obj))
  
          if serializer == cls:
              return cls._serialize_default(obj)
          else:
              return serializer.serialize(obj)
docs: :type obj: int|str|bool|float|bytes|unicode|list|dict|object
  
          :rtype: int|str|bool|list|dict