code: def row_to_dict(schema, row):
      row_dict = {}
      for k, field in schema.items():
          if field.feature_type == FeatureType.IMAGE:
              row_dict[k] = row[k]
          elif field.feature_type == FeatureType.NDARRAY:
              row_dict[k] = decode_ndarray(row[k])
          else:
              row_dict[k] = row[k]
  
      return row_dict
  
imports: from collections import namedtuple
  from io import BytesIO
  import numpy
  from itertools import chain, islice
  from enum import Enum
  import json
  from bigdl.dllib.utils.log4Error import *
  from typing import Any, Dict, Iterator, List, Union, TYPE_CHECKING
label_desc: Use image node_id 6 for calling a global function with example usage: row_to_dict(schema, row) and returns: row_dict