class_docstr: Holds leaves and comments. Can be printed with `str(line)`.
class_docstr_tok: ["Holds","leaves","and","comments",".","Can","be","printed","with","`","str","(","line",")","`","."]
code: def contains_unsplittable_type_ignore(self) -> bool:
      if not self.leaves:
          return False
  
      # If a 'type: ignore' is attached to the end of a line, we
      # can't split the line, because we can't know which of the
      # subexpressions the ignore was meant to apply to.
      #
      # We only want this to apply to actual physical lines from the
      # original source, though: we don't want the presence of a
      # 'type: ignore' at the end of a multiline expression to
      # justify pushing it all onto one line. Thus we
      # (unfortunately) need to check the actual source lines and
      # only report an unsplittable 'type: ignore' if this line was
      # one line in the original code.
  
      # Grab the first and last line numbers, skipping generated leaves
      first_line = next(
          (leaf.lineno for leaf in self.leaves if leaf.lineno != 0), 0
      )
      last_line = next(
          (
              leaf.lineno
              for leaf in reversed(self.leaves)
              if leaf.lineno != 0
          ),
          0,
      )
  
      if first_line == last_line:
          # We look at the last two leaves since a comma or an
          # invisible paren could have been added at the end of the
          # line.
          for node in self.leaves[-2:]:
              for comment in self.comments.get(id(node), []):
                  if is_type_ignore_comment(comment):
                      return True
  
      return False
  
imports: import itertools
  import math
  from dataclasses import dataclass, field
  from typing import Callable, Dict, Iterator, List, Optional, Sequence, Tuple, TypeVar, Union, cast
  from black.brackets import COMMA_PRIORITY, DOT_PRIORITY, BracketTracker
  from black.mode import Mode, Preview
  from black.nodes import BRACKETS, CLOSING_BRACKETS, OPENING_BRACKETS, STANDALONE_COMMENT, TEST_DESCENDANTS, child_towards, is_docstring, is_import, is_multiline_string, is_one_sequence_between, is_type_comment, is_type_ignore_comment, is_with_or_async_with_stmt, make_simple_prefix, replace_child, syms, whitespace
  from black.strings import str_width
  from blib2to3.pgen2 import token
  from blib2to3.pytree import Leaf, Node
label_desc: Use image node_id 20 for calling the Line obj's underlying member method code with example usage: obj.contains_unsplittable_type_ignore() and returns: False, False, True