code: def cast_scalar_indexer(val):
      
      # assumes lib.is_scalar(val)
      if lib.is_float(val) and val == int(val):
          return int(val)
      return val
docs: To avoid numpy DeprecationWarnings, cast float to integer where valid.
  
      Parameters
      ----------
      val : scalar
  
      Returns
      -------
      outval : scalar