code: def as_json_table_type(x: DtypeObj) -> str:
      """
      Convert a NumPy / pandas type to its corresponding json_table.
  
      Parameters
      ----------
      x : np.dtype or ExtensionDtype
  
      Returns
      -------
      str
          the Table Schema data types
  
      Notes
      -----
      This table shows the relationship between NumPy / pandas dtypes,
      and Table Schema dtypes.
  
      ==============  =================
      Pandas type     Table Schema type
      ==============  =================
      int64           integer
      float64         number
      bool            boolean
      datetime64[ns]  datetime
      timedelta64[ns] duration
      object          str
      categorical     any
      =============== =================
      """
      if is_integer_dtype(x):
          return "integer"
      elif is_bool_dtype(x):
          return "boolean"
      elif is_numeric_dtype(x):
          return "number"
      elif (
          is_datetime64_dtype(x)
          or is_datetime64tz_dtype(x)
          or is_period_dtype(x)
      ):
          return "datetime"
      elif is_timedelta64_dtype(x):
          return "duration"
      elif is_categorical_dtype(x):
          return "any"
      elif is_extension_array_dtype(x):
          return "any"
      elif is_string_dtype(x):
          return "string"
      else:
          return "any"
  
file_path: catboost/contrib/python/pandas/py3/pandas/io/json/_table_schema.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, cast
  import warnings
  from pandas._libs.json import loads
  from pandas._libs.tslibs import timezones
  from pandas._typing import DtypeObj, JSONSerializable
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.base import _registry
  from pandas.core.dtypes.common import is_bool_dtype, is_categorical_dtype, is_datetime64_dtype, is_datetime64tz_dtype, is_extension_array_dtype, is_integer_dtype, is_numeric_dtype, is_period_dtype, is_string_dtype, is_timedelta64_dtype
  from pandas.core.dtypes.dtypes import CategoricalDtype
  from pandas import DataFrame
  import pandas.core.common
label_desc: Use image node_id 1 for calling a global function with example usage: as_json_table_type(x) and returns: str, str, str, str, str, str, str, str, str