code: def get_schema(list_data_dict, struct, array_dict_types):
      """Get a schema of the dataset's structure and data types."""
      # Get the structure of the JSON objects in the database
      # This is similar to getting a JSON schema but with slightly different format
      for _i, item in enumerate(list_data_dict):
          # If the list contains dict objects
          for k, v in item.items():
              # Check if key already exists in template
              if k not in struct.keys():
                  if isinstance(v, list):
                      if len(v) > 0 and isinstance(v[0], list):
                          # nested list structure
                          struct[k] = type(v)  # type list
                      elif len(v) > 0 and not (
                          isinstance(v[0], list)
                          or isinstance(v[0], dict)
                      ):
                          # list of singular values
                          struct[k] = type(v)  # type list
                      else:
                          # list of dicts
                          array_dict_types.append(
                              k
                          )  # keep track of keys that are type list[dict]
                          struct[k] = {}
                          struct[k] = get_schema(
                              v, struct[k], array_dict_types
                          )
                  elif isinstance(v, dict):
                      struct[k] = {}
                      struct[k] = get_schema(
                          [v], struct[k], array_dict_types
                      )
                  else:
                      struct[k] = type(v)
              else:
                  # Get the value of struct[k] which is the current template
                  # Find new keys and then merge the two templates together
                  cur_struct = struct[k]
                  if isinstance(v, list):
                      if len(v) > 0 and isinstance(v[0], list):
                          # nested list coordinate structure
                          # if the value in the item is currently None, then update
                          if v is not None:
                              struct[k] = type(v)  # type list
                      elif len(v) > 0 and not (
                          isinstance(v[0], list)
                          or isinstance(v[0], dict)
                      ):
                          # single list with values
                          # if the value in the item is currently None, then update
                          if v is not None:
                              struct[k] = type(v)  # type list
                      else:
                          array_dict_types.append(
                              k
                          )  # keep track of keys that are type list[dict]
                          struct[k] = {}
                          struct[k] = get_schema(
                              v, struct[k], array_dict_types
                          )
                          # merge cur_struct and struct[k], remove duplicates
                          struct[k] = merge(struct[k], cur_struct)
                  elif isinstance(v, dict):
                      struct[k] = {}
                      struct[k] = get_schema(
                          [v], struct[k], array_dict_types
                      )
                      # merge cur_struct and struct[k], remove duplicates
                      struct[k] = merge(struct[k], cur_struct)
                  else:
                      # if the value in the item is currently None, then update
                      if v is not None:
                          struct[k] = type(v)
  
      return struct
  
file_path: wandb/wandb/integration/prodigy/prodigy.py
imports: import base64
  import collections.abc
  import io
  import urllib
  from copy import deepcopy
  import pandas
  from PIL import Image
  import wandb
  from wandb import util
  from wandb.plots.utils import test_missing
  from wandb.sdk.lib import telemetry
label_desc: Use image node_id 3 for calling a global function with example usage: get_schema(list_data_dict, struct, array_dict_types) and returns: struct