code: def prepend_block(self, node, reverse=False):
      
      if not isinstance(node, grammar.STATEMENTS):
        raise ValueError
      if reverse:
        self.to_prepend_block[-1].appendleft(node)
      else:
        self.to_prepend_block[-1].append(node)
docs: Prepend a statement to the current block.
  
      Args:
        node: The statement to prepend.
        reverse: When called multiple times, this flag determines whether the
            statement should be prepended or appended to the already inserted
            statements.
  
      Raises:
        ValueError: If the given node is not a statement.