code: def serialize_fields(schema: t.Dict) -> t.List[SampleField]:
      data = []
  
      if schema:
          for path, field in schema.items():
              if isinstance(field, fo.EmbeddedDocumentField):
                  embedded_doc_type = etau.get_class_name(
                      field.document_type
                  )
              elif (
                  isinstance(field, fo.ListField)
                  and field.field
                  and isinstance(field.field, fo.EmbeddedDocumentField)
              ):
                  embedded_doc_type = etau.get_class_name(
                      field.field.document_type
                  )
              else:
                  embedded_doc_type = None
  
              if (
                  isinstance(field, (fo.DictField, fo.ListField))
                  and field.field is not None
              ):
                  subfield = etau.get_class_name(field.field)
              else:
                  subfield = None
  
              data.append(
                  SampleField(
                      path=path,
                      db_field=field.db_field,
                      ftype=etau.get_class_name(field),
                      embedded_doc_type=embedded_doc_type,
                      subfield=subfield,
                      description=field.description,
                      info=_convert_mongoengine_data(field.info)
                      if isinstance(field.info, BaseDict)
                      else field.info,
                  )
              )
  
      return data
  
imports: import logging
  import typing
  from bson import json_util
  from dataclasses import asdict
  from mongoengine.base import BaseDict, BaseList
  import strawberry
  import eta.core.serial
  import eta.core.utils
  import fiftyone
  import fiftyone.core.clips
  from fiftyone.core.config import AppConfig
  import fiftyone.core.dataset
  from fiftyone.core.odm.dataset import ColorScheme
  import fiftyone.core.media
  import fiftyone.core.odm
  from fiftyone.core.spaces import Space
  import fiftyone.core.utils
  import fiftyone.core.view
  from fiftyone.server.scalars import JSON
label_desc: Use image node_id 1 for calling a global function with example usage: serialize_fields(schema) and returns: data