code: def line_range(atok: ASTText, node: ast.AST) -> Tuple[int, int]:
      """
      Returns a pair of numbers representing a half open range
      (i.e. suitable as arguments to the `range()` builtin)
      of line numbers of the given AST nodes.
      """
      if isinstance(node, getattr(ast, "match_case", ())):
          start, _end = line_range(atok, node.pattern)
          _start, end = line_range(atok, node.body[-1])
          return start, end
      else:
          (start, _), (end, _) = atok.get_text_positions(
              node, padded=False
          )
          return start, end + 1
  
imports: import ast
  import itertools
  import types
  from collections import OrderedDict, Counter, defaultdict
  from types import FrameType, TracebackType
  from typing import Iterator, List, Tuple, Iterable, Callable, Union, TypeVar, Mapping
  from asttokens import ASTText
label_desc: Use image node_id 3 for calling a global function with example usage: line_range(atok, node) and returns: start,  end, start,  unknown