code: def _iter_return(tup, fxn, invalid_error):
          
  
          try:
              val = fxn(*tup)
          except (IndexError, ValueError):
              if invalid_error:
                  # Raise the exception if invalid_error indicates
                  raise
              else:
                  # Otherwise, just return a 'None' value
                  return None
              ## end if
          else:
              # Good value; just generate it
              return val
docs: Wrapper for exception/|None| output handling of X_iter methods.
  
          Attempts to pass `tup` as arguments to `fxn`.  If the call is
          successful, returns the value produced. If
          :exc:`~exceptions.IndexError` or
          :exc:`~exceptions.ValueError`
          is raised, indicating an invalid index value, re-raise if
          `invalid_error` is |True| or return |None| if |False|.
  
          Other exceptions are left uncaught.
  
          Parameters
          ----------
          tup
              |tuple| --
              Input arguments to unpack as arguments to `fxn`
  
          fxn
              callable --
              Function/method to call to calculate the return value
  
          invalid_error
              |bool| --
              Flag for whether to return |None| on an
              :exc:`~exceptions.IndexError` or
              :exc:`~exceptions.ValueError`, or to re-raise.
  
          Returns
          -------
          val
              |npfloat_| or |None| --
              Calculated value from fxn(*tup) call, or 'None' value indicating
              IndexError / ValueError