code: def _to_object(schema, data):
      obj = {}
      for idx, (name, _type) in enumerate(
          zip(schema.names, schema.fields)
      ):
          if isinstance(data, Struct):
              val = data.get_item(name)
          else:
              val = data[idx]
  
          if isinstance(_type, Schema):
              obj[name] = _to_object(_type, val)
          elif isinstance(_type, Array):
              if isinstance(_type.array_of, (Array, Schema)):
                  obj[name] = [
                      _to_object(_type.array_of, x) for x in val
                  ]
              else:
                  obj[name] = val
          else:
              obj[name] = val
  
      return obj
  
imports: from __future__ import absolute_import
  import abc
  from kafka.protocol.struct import Struct
  from kafka.protocol.types import Int16, Int32, String, Schema, Array, TaggedFields
label_desc: Use image node_id 1 for calling a global function with example usage: _to_object(schema, data) and returns: obj