code: def serialize(serializer, format, value):
      if (
          isinstance(value, CheckedType)
          and serializer is PFIELD_NO_SERIALIZER
      ):
          return value.serialize(format)
  
      return serializer(format, value)
  
imports: import six
  import sys
  from pyrsistent._checked_types import CheckedPMap, CheckedPSet, CheckedPVector, CheckedType, InvariantException, _restore_pickle, get_type, maybe_parse_user_type, maybe_parse_many_user_types
  from pyrsistent._checked_types import optional
  from pyrsistent._checked_types import wrap_invariant
  import inspect
label_desc: Use image node_id 3 for calling a global function with example usage: serialize(serializer, format, value) and returns: serializer, value