code: def trunc_if_integer(n: Any) -> Any:
      
      if n == int(n):
          return int(n)
      return n
docs: Truncates floats that are integers to their integer representation.
      That is, converts ``1.0`` to ``1``, etc.
      Otherwise, returns the starting value.
      Will raise an exception if the input cannot be converted to ``int``.