nodes: 0, module; 1, function_definition; 2, function_name:previous_sibling; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, return_statement; 9, comment:""" Returns the previous sibling of the current node.
  
          The previous sibling is searched in the parent node if we are not considering a top-level
          node. Otherwise it is searched inside the list of nodes (which should be sorted by tree ID)
          that is associated with the considered tree instance.
          """; 10, attribute; 11, block; 12, else_clause; 13, identifier:sibling; 14, identifier:self; 15, identifier:parent; 16, expression_statement; 17, expression_statement; 18, expression_statement; 19, block; 20, assignment; 21, assignment; 22, assignment; 23, expression_statement; 24, expression_statement; 25, expression_statement; 26, identifier:nodes; 27, attribute; 28, identifier:index; 29, call; 30, identifier:sibling; 31, conditional_expression:nodes[index - 1] if index > 0 else None; 32, assignment; 33, assignment; 34, assignment; 35, attribute; 36, identifier:children; 37, attribute; 38, argument_list; 39, subscript; 40, comparison_operator:index > 0; 41, None; 42, identifier:nodes; 43, attribute; 44, identifier:index; 45, call; 46, identifier:sibling; 47, parenthesized_expression; 48, identifier:self; 49, identifier:parent; 50, identifier:nodes; 51, identifier:index; 52, identifier:self; 53, identifier:nodes; 54, binary_operator:index - 1; 55, identifier:index; 56, integer:0; 57, attribute; 58, identifier:nodes; 59, attribute; 60, argument_list; 61, conditional_expression:next((n for n in reversed(nodes[:index]) if n.level == self.level), None)
                  if index > 0 else None; 62, identifier:index; 63, integer:1; 64, identifier:self; 65, identifier:tree; 66, identifier:nodes; 67, identifier:index; 68, identifier:self; 69, call; 70, comparison_operator:index > 0; 71, None; 72, identifier:next; 73, argument_list; 74, identifier:index; 75, integer:0; 76, generator_expression; 77, None; 78, identifier:n; 79, for_in_clause; 80, if_clause; 81, identifier:n; 82, call; 83, comparison_operator:n.level == self.level; 84, identifier:reversed; 85, argument_list; 86, attribute; 87, attribute; 88, subscript; 89, identifier:n; 90, identifier:level; 91, identifier:self; 92, identifier:level; 93, identifier:nodes; 94, slice; 95, identifier:index
code: def previous_sibling(self):
          """ Returns the previous sibling of the current node.
  
          The previous sibling is searched in the parent node if we are not considering a top-level
          node. Otherwise it is searched inside the list of nodes (which should be sorted by tree ID)
          that is associated with the considered tree instance.
          """
          if self.parent:
              nodes = self.parent.children
              index = nodes.index(self)
              sibling = nodes[index - 1] if index > 0 else None
          else:
              nodes = self.tree.nodes
              index = nodes.index(self)
              sibling = (
                  next((n for n in reversed(nodes[:index]) if n.level == self.level), None)
                  if index > 0 else None
              )
          return sibling