code: def _finalize_embedded_doc_fields(fields_dict):
      fields = []
      for field in fields_dict.values():
          if field is not None:
              fields.append(field)
              if field["ftype"] == fof.EmbeddedDocumentField:
                  field["fields"] = _finalize_embedded_doc_fields(
                      field["fields"]
                  )
  
      return fields
  
imports: from datetime import date, datetime
  import inspect
  import json
  import numbers
  import six
  import sys
  from bson import Binary, json_util, ObjectId, SON
  import numpy
  import pytz
  import fiftyone
  import fiftyone.core.fields
  import fiftyone.core.media
  import fiftyone.core.utils
label_desc: Use image node_id 12 for calling a global function with example usage: _finalize_embedded_doc_fields(fields_dict) and returns: fields