code: def type_description(schema):
      """Return a concise type description for the given schema"""
      if (
          not schema
          or not isinstance(schema, dict)
          or schema.keys() == {"description"}
      ):
          return "any"
      elif "$ref" in schema:
          return ":class:`{}`".format(schema["$ref"].split("/")[-1])
      elif "enum" in schema:
          return "[{}]".format(
              ", ".join(repr(s) for s in schema["enum"])
          )
      elif "type" in schema:
          if isinstance(schema["type"], list):
              return "[{}]".format(", ".join(schema["type"]))
          elif schema["type"] == "array":
              return "array({})".format(
                  type_description(schema.get("items", {}))
              )
          elif schema["type"] == "object":
              return "dict"
          else:
              return "`{}`".format(schema["type"])
      elif "anyOf" in schema:
          return "anyOf({})".format(
              ", ".join(type_description(s) for s in schema["anyOf"])
          )
      else:
          warnings.warn(
              "cannot infer type for schema with keys {}"
              "".format(schema.keys()),
              stacklevel=1,
          )
          return "--"
  
imports: import importlib
  import re
  import sys
  import warnings
  from os.path import abspath, dirname
  from docutils import nodes, utils, frontend
  from docutils.parsers.rst import Directive
  from docutils.parsers.rst.directives import flag
  from myst_parser.docutils_ import Parser
  from sphinx import addnodes
  from tools.schemapi.utils import fix_docstring_issues, SchemaInfo
label_desc: Use image node_id 1 for calling a global function with example usage: type_description(schema) and returns: str, str, str, str, str, str, str, str, str