code: def is_re(obj) -> bool:
      """
      Check if the object is a regex pattern instance.
  
      Parameters
      ----------
      obj : The object to check
  
      Returns
      -------
      bool
          Whether `obj` is a regex pattern.
  
      Examples
      --------
      >>> from pandas.api.types import is_re
      >>> import re
      >>> is_re(re.compile(".*"))
      True
      >>> is_re("foo")
      False
      """
      return isinstance(obj, Pattern)
  
file_path: catboost/contrib/python/pandas/py3/pandas/core/dtypes/inference.py
imports: from __future__ import annotations
  from collections import abc
  from numbers import Number
  import re
  from typing import Pattern
  import numpy
  from pandas._libs import lib
label_desc: Use image node_id 4 for calling a global function with example usage: is_re(obj) and returns: isinstance