code: def visit_statements(self, nodes):
      
      primals, adjoints = [], collections.deque()
      for node in nodes:
        primal, adjoint = self.visit(node)
        if not isinstance(primal, list):
          primal = [primal]
        if not isinstance(adjoint, list):
          adjoint = [adjoint]
        # Methods will return `None` if the node is to be removed, so remove them
        primals.extend(filter(None, primal))
        # We reverse the order of the adjoints, but not the statements in
        # the adjoint itself
        adjoints.extendleft(filter(None, adjoint[::-1]))
      return primals, list(adjoints)
docs: Generate the adjoint of a series of statements.