code: def _merge_embedded_doc_fields(fields_dict, fields):
      for field in fields:
          name = field["name"]
          ftype = field["ftype"]
          subfield = field.get("subfield", None)
  
          if name not in fields_dict:
              fields_dict[name] = field
              if ftype == fof.EmbeddedDocumentField:
                  field["fields"] = {
                      f["name"]: f for f in field["fields"]
                  }
          else:
              efield = fields_dict[name]
              etype = efield["ftype"]
              if etype != ftype:
                  # @todo could provide an `add_mixed=True` option to declare
                  # mixed fields like this as a generic `Field`
                  fields_dict[name] = None
              elif etype in (fof.ListField, fof.DictField):
                  if (
                      "subfield" in efield
                      and efield["subfield"] != subfield
                  ):
                      efield["subfield"] = None
                  elif subfield is not None:
                      efield["subfield"] = subfield
              elif ftype == fof.EmbeddedDocumentField:
                  _merge_embedded_doc_fields(
                      efield["fields"], field["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 11 for calling a global function with example usage: _merge_embedded_doc_fields(fields_dict, fields) without return types