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",")","`","."]
docstr: Like :func:`append()` but disallow invalid standalone comment structure.
  
  Raises ValueError when any `leaf` is appended after a standalone comment
  or when a standalone comment is not the first leaf on the line.
code: def append_safe(self, leaf: Leaf, preformatted: bool = False) -> None:
      """Like :func:`append()` but disallow invalid standalone comment structure.
  
      Raises ValueError when any `leaf` is appended after a standalone comment
      or when a standalone comment is not the first leaf on the line.
      """
      if (
          self.bracket_tracker.depth == 0
          or self.bracket_tracker.any_open_for_or_lambda()
      ):
          if self.is_comment:
              raise ValueError("cannot append to standalone comments")
  
          if self.leaves and leaf.type == STANDALONE_COMMENT:
              raise ValueError(
                  "cannot append standalone comments to a populated line"
              )
  
      self.append(leaf, preformatted=preformatted)
  
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_funcdef, 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 2 for calling the Line obj's underlying member method code with example usage: obj.append_safe(leaf, preformatted) without return types