code: def dtype_to_arrow_c_fmt(dtype: DtypeObj) -> str:
      """
      Represent pandas `dtype` as a format string in Apache Arrow C notation.
  
      Parameters
      ----------
      dtype : np.dtype
          Datatype of pandas DataFrame to represent.
  
      Returns
      -------
      str
          Format string in Apache Arrow C notation of the given `dtype`.
      """
      if isinstance(dtype, pd.CategoricalDtype):
          return ArrowCTypes.INT64
      elif dtype == np.dtype("O"):
          return ArrowCTypes.STRING
  
      format_str = getattr(ArrowCTypes, dtype.name.upper(), None)
      if format_str is not None:
          return format_str
  
      if is_datetime64_dtype(dtype):
          # Selecting the first char of resolution string:
          # dtype.str -> '<M8[ns]'
          resolution = re.findall(
              r"\[(.*)\]", typing.cast(np.dtype, dtype).str
          )[0][:1]
          return ArrowCTypes.TIMESTAMP.format(
              resolution=resolution, tz=""
          )
  
      raise NotImplementedError(
          f"Conversion of {dtype} to Arrow C format string is not implemented."
      )
  
file_path: catboost/contrib/python/pandas/py3/pandas/core/interchange/utils.py
imports: from __future__ import annotations
  import re
  import typing
  import numpy
  from pandas._typing import DtypeObj
  import pandas
  from pandas.api.types import is_datetime64_dtype
label_desc: Use image node_id 1 for calling a global function with example usage: dtype_to_arrow_c_fmt(dtype) and returns: ArrowCTypes, format_str, ArrowCTypes, ArrowCTypes