code: def __init__(self, msg):
      # NOTE this assume that InvalidNextException is only raised
      # at the top level of next()
      _, line_no, _, _ = traceback.extract_stack()[-3]
      super(InvalidNextException, self).__init__(msg, line_no)
  
imports: import inspect
  import os
  import sys
  import traceback
  from itertools import islice
  from types import FunctionType, MethodType
  from typing import Any, Callable, List, Optional, Tuple
  from .None import cmd_with_io
  from .parameters import DelayedEvaluationParameter, Parameter
  from .exception import MetaflowException, MissingInMergeArtifactsException, UnhandledInMergeArtifactsException
  from .graph import FlowGraph
  from .unbounded_foreach import UnboundedForeachInput
  from .datastore.inputs import Inputs
label_desc: Use image node_id 1 to create a new InvalidNextException object from inherited base classes: MetaflowException with example: obj = InvalidNextException(msg)