code: def check_to_pydatetime_deprecation(catch_deprecation_warnings: bool):
      if PANDAS_GE_210 and catch_deprecation_warnings:
          with warnings.catch_warnings():
              warnings.filterwarnings(
                  "ignore",
                  message=".*DatetimeProperties.to_pydatetime is deprecated",
                  category=FutureWarning,
              )
              yield
      else:
          yield
  
imports: from __future__ import annotations
  import contextlib
  import string
  import warnings
  import numpy
  import pandas
  from packaging.version import Version
  import pandas.testing
label_desc: Use image node_id 16 for calling a global function with example usage: check_to_pydatetime_deprecation(catch_deprecation_warnings) without return types