docs: def format_gmeta(data, acl=None, identifier=None):
      """Format input into GMeta format, suitable for ingesting into Globus Search.
      Formats a dictionary into a GMetaEntry.
      Formats a list of GMetaEntry into a GMetaList inside a GMetaIngest.
  
      **Example usage**::
  
          glist = []
          for document in all_my_documents:
              gmeta_entry = format_gmeta(document, ["public"], document["id"])
              glist.append(gmeta_entry)
          ingest_ready_document = format_gmeta(glist)
  
      Arguments:
          data (dict or list): The data to be formatted.
                  If data is a dict, arguments ``acl`` and ``identifier`` are required.
                  If data is a list, it must consist of GMetaEntry documents.
          acl (list of str): The list of Globus UUIDs allowed to view the document,
                  or the special value ``["public"]`` to allow anyone access.
                  Required if data is a dict. Ignored if data is a list.
                  Will be formatted into URNs if required.
          identifier (str): A unique identifier for this document. If this value is not unique,
                  ingests into Globus Search may merge entries.
                  Required is data is a dict. Ignored if data is a list.
  
      Returns:
          dict (if ``data`` is ``dict``): The data as a GMetaEntry.
          dict (if ``data`` is ``list``): The data as a GMetaIngest.
      """
      if isinstance(data, dict):
          if acl is None or identifier is None:
              raise ValueError("acl and identifier are required when formatting a GMetaEntry.")
          if isinstance(acl, str):
              acl = [acl]
          # "Correctly" format ACL entries into URNs
          prefixed_acl = []
          for uuid in acl:
              # If entry is not special value "public" and is not a URN, make URN
              # It is not known what the type of UUID is, so use both
              # This solution is known to be hacky
              if uuid != "public" and not uuid.lower().startswith("urn:"):
                  prefixed_acl.append("urn:globus:auth:identity:"+uuid.lower())
                  prefixed_acl.append("urn:globus:groups:id:"+uuid.lower())
              # Otherwise, no modification
              else:
                  prefixed_acl.append(uuid)
  
          return {
              "@datatype": "GMetaEntry",
              "@version": "2016-11-09",
              "subject": identifier,
              "visible_to": prefixed_acl,
              "content": data
              }
  
      elif isinstance(data, list):
          return {
              "@datatype": "GIngest",
              "@version": "2016-11-09",
              "ingest_type": "GMetaList",
              "ingest_data": {
                  "@datatype": "GMetaList",
                  "@version": "2016-11-09",
                  "gmeta": data
                  }
              }
  
      else:
          raise TypeError("Cannot format '" + str(type(data)) + "' into GMeta.")