code: def parse_logic(struct):
      lineno = struct.lineno
  
      kw = dict(lineno=lineno, col_offset=0)
      if isinstance(struct.right, LogicalOp):
          ast_right, insert_into = parse_logic(struct.right)
          assert insert_into is None
      else:
          ast_right = struct.right
  
      parent = struct.parent
  
      Logic = _ast.Or if struct.flag == "OR" else _ast.And
  
      if isinstance(parent, LogicalOp):
          ast_parent, insert_into = parse_logic(struct.parent)
  
          new_insert_into = [ast_right]
          insert_into.insert(
              0, _ast.BoolOp(op=Logic(), values=new_insert_into, **kw)
          )
          return ast_parent, new_insert_into
  
      elif parent is None:
          insert_into = [ast_right]
          return (
              _ast.BoolOp(op=Logic(), values=insert_into, **kw),
              insert_into,
          )
  
      else:
          bool_op = _ast.BoolOp(
              op=Logic(), values=[parent, ast_right], **kw
          )
          return bool_op, None
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import opcode
  import _ast
  from ..bytecodetools.instruction import Instruction
  from ..asttools.visitors.print_visitor import print_ast
  from ..utils import py3op, py2op, py3
label_desc: Use image node_id 6 for calling a global function with example usage: parse_logic(struct) and returns: ast_parent,  new_insert_into, _ast,  insert_into, bool_op,  None