code: def normalise_json_content(
      content, json_path: str = "json"
  ) -> str | bool | list | dict:
      """
      Normalize content or all values of content if it is a dict to a string.
  
      The function will throw if content contains non-string or non-numeric non-boolean
      types. The reason why we have this function is because the ``self.json`` field
      must be a dict with only string values. This is because ``render_template`` will
      fail for numerical values.
  
      The only one exception is when we have boolean values, they can not be converted
      to string type because databricks does not understand 'True' or 'False' values.
      """
      normalise = normalise_json_content
      if isinstance(content, (str, bool)):
          return content
      elif isinstance(content, (int, float)):
          # Databricks can tolerate either numeric or string types in the API backend.
          return str(content)
      elif isinstance(content, (list, tuple)):
          return [
              normalise(e, f"{json_path}[{i}]")
              for i, e in enumerate(content)
          ]
      elif isinstance(content, dict):
          return {
              k: normalise(v, f"{json_path}[{k}]")
              for k, v in content.items()
          }
      else:
          param_type = type(content)
          msg = f"Type {param_type} used for parameter {json_path} is not a number or a string"
          raise AirflowException(msg)
  
imports: from __future__ import annotations
  from airflow.exceptions import AirflowException
  from airflow.providers.databricks.hooks.databricks import RunState
label_desc: Use image node_id 1 for calling a global function with example usage: normalise_json_content(content, json_path) and returns: content, str, unknown, unknown