code: def _can_omit_closing_paren(
      line: Line, *, last: Leaf, line_length: int
  ) -> bool:
      """See `can_omit_invisible_parens`."""
      length = 4 * line.depth
      seen_other_brackets = False
      for _index, leaf, leaf_length in line.enumerate_with_length():
          length += leaf_length
          if leaf is last.opening_bracket:
              if seen_other_brackets or length <= line_length:
                  return True
  
          elif leaf.type in OPENING_BRACKETS:
              # There are brackets we can further split on.
              seen_other_brackets = 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 7 for calling a global function with example usage: _can_omit_closing_paren(line) and returns: False, True