code: def idempotent(
      func: Callable, df: pd.DataFrame, *args: Any, **kwargs: Any
  ):
      """Raises an error if a function operating on a DataFrame is not
      idempotent.
  
      That is, `func(func(df)) = func(df)` is not `True` for all `df`.
  
      Args:
          func: A Python method.
          df: A pandas `DataFrame`.
          *args: Positional arguments supplied to the method.
          **kwargs: Keyword arguments supplied to the method.
  
      Raises:
          ValueError: If `func` is found to not be idempotent for the given
              DataFrame (`df`).
      """
      if not func(df, *args, **kwargs) == func(
          func(df, *args, **kwargs), *args, **kwargs
      ):
          raise ValueError(
              "Supplied function is not idempotent for the given DataFrame."
          )
  
imports: from __future__ import annotations
  import importlib
  import os
  import socket
  import sys
  from functools import singledispatch, wraps
  from pathlib import Path
  from typing import Any, Callable, Dict, Iterable, List, Union
  from warnings import warn
  import numpy
  import pandas
label_desc: Use image node_id 9 for calling a global function with example usage: idempotent(func, df) without return types