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_uncollapsable_type_comments(self) -> bool:
      ignored_ids = set()
      try:
          last_leaf = self.leaves[-1]
          ignored_ids.add(id(last_leaf))
          if last_leaf.type == token.COMMA or (
              last_leaf.type == token.RPAR and not last_leaf.value
          ):
              # When trailing commas or optional parens are inserted by Black for
              # consistency, comments after the previous last element are not moved
              # (they don't have to, rendering will still be correct).  So we ignore
              # trailing commas and invisible.
              last_leaf = self.leaves[-2]
              ignored_ids.add(id(last_leaf))
      except IndexError:
          return False
  
      # A type comment is uncollapsable if it is attached to a leaf
      # that isn't at the end of the line (since that could cause it
      # to get associated to a different argument) or if there are
      # comments before it (since that could cause it to get hidden
      # behind a comment.
      comment_seen = False
      for leaf_id, comments in self.comments.items():
          for comment in comments:
              if is_type_comment(comment):
                  if comment_seen or (
                      not is_type_ignore_comment(comment)
                      and leaf_id not in ignored_ids
                  ):
                      return True
  
              comment_seen = 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 19 for calling the Line obj's underlying member method code with example usage: obj.contains_uncollapsable_type_comments() and returns: False, False, True