code: def _on_serialize_tree(tree):
      return (
          cloudpickle.dumps(tree) if not hasattr(tree, "key") else tree
      )
  
imports: import cloudpickle
  import numpy
  from ...core import Object, OBJECT_TYPE, OBJECT_CHUNK_TYPE, recursive_tile
  from ...serialization.serializables import KeyField, Int32Field, DictField, AnyField, BoolField
  from ...tensor.core import TensorOrder
  from ...utils import has_unknown_shape, tokenize
  from ..operands import LearnOperand, LearnOperandMixin, OutputType
label_desc: Use image node_id 1 for calling a global function with example usage: _on_serialize_tree(tree) and returns: unknown