code: def encode_schema(schema):
      copy_schema = schema.copy()
  
      for k, v in copy_schema.items():
          copy_schema[k] = v.to_dict()
  
      return json.dumps(copy_schema, cls=EnumEncoder)
  
imports: import copy
  import os
  from collections import namedtuple
  from io import BytesIO
  import numpy
  import pyarrow
  from itertools import chain, islice
  from enum import Enum
  import json
label_desc: Use image node_id 3 for calling a global function with example usage: encode_schema(schema) and returns: json