code: def _minify_classpaths(s: str) -> str:
      # strip private polars classpaths, leaving the classname:
      # * "pl.Expr" -> "Expr"
      # * "polars.expr.expr.Expr" -> "Expr"
      # * "polars.lazyframe.frame.LazyFrame" -> "LazyFrame"
      # also:
      # * "datetime.date" => "date"
      s = s.replace("datetime.", "")
      return re.sub(
          pattern=r"""
          ~?
          (
            (?:pl|
              (?:polars\.
                (?:_reexport|datatypes)
              )
            )
            (?:\.[a-z.]+)?\.
            ([A-Z][\w.]+)
          )
          """,
          repl=r"\2",
          string=s,
          flags=re.VERBOSE,
      )
  
file_path: polars/py-polars/docs/source/conf.py
imports: from __future__ import annotations
  import inspect
  import os
  import re
  import sys
  import warnings
  from pathlib import Path
  from typing import Any
  import sphinx_autosummary_accessors
label_desc: Use image node_id 2 for calling a global function with example usage: _minify_classpaths(s) and returns: re