<|start_filename|>air/tests/test_module/issues/scripts/issue_177.clj<|end_filename|>
(xor
 (seq
  (seq
   (call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
   (new $res
    (seq
     (seq
      (seq
       (call -relay- ("op" "noop") [])
       (xor
        (seq
         (call "<KEY>" ("op" "string_to_b58") ["<KEY>"] k)
         (par
          (seq
           (call "<KEY>" ("kad" "neighborhood") [k [] []] nodes)
           (call %init_peer_id% ("op" "noop") [])
           )
          (seq
           (fold nodes n
                 (par
                  (seq
                   (xor
                    (call n ("peer" "timestamp_ms") [] $res)
                    (seq
                     (call -relay- ("op" "noop") [])
                     (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
                     )
                    )
                   (call %init_peer_id% ("op" "noop") [])
                   )
                  (next n)
                  )
                 )
           (call %init_peer_id% ("op" "noop") [])
           )
          )
         )
        (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
        )
       )
      (par
       (call %init_peer_id% ("op" "identity") [$res.$.[19]!])
       (call %init_peer_id% ("peer" "timeout") [1000 "timeout"])
       )
      )
     (call %init_peer_id% ("op" "identity") [$res] res-fix)
     )
    )
   )
  (call %init_peer_id% ("--after-callback-srv-service--" "print-and-stop") [res-fix nodes])
  )
 (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
 )


<|start_filename|>air/tests/test_module/integration/scripts/fold_early_exit.clj<|end_filename|>
(seq
 (seq
  (seq
   (seq
    (seq
     (call "{0}" ("" "") ["stream_1"] stream_1_ingredients)
     (call "{0}" ("" "") ["stream_2"] stream_2_ingredients)
     )
    (call "{0}" ("" "") ["stream_3"] stream_3_ingredients)
    )
   (call "{0}" ("" "") ["stream_4"] stream_4_ingredients)
   )
  (seq
   (seq
    (seq
     (fold stream_1_ingredients v1
           (seq
            (call "{1}" ("" "") [v1] $stream_1)
            (next v1)
            )
           )
     (fold stream_2_ingredients v2
           (seq
            (call "{1}" ("" "") [v2] $stream_2)
            (next v2)
            )
           )
     )
    (fold stream_3_ingredients v3
          (seq
           (call "{1}" ("" "") [v3] $stream_3)
           (next v3)
           )
          )
    )
   (fold stream_4_ingredients v4
         (seq
          (call "{1}" ("" "") [v4] $stream_4)
          (next v4)
          )
         )
   )
  )
 (par
 (xor
 (fold $stream_1 v1
       (seq
        (fold $stream_2 v2
              (seq
               (seq
               (fold $stream_3 v3
                     (seq
                      (fold $stream_4 v4
                            (seq
                             (call "{2}" ("" "") [])
                             (next v4)
                              )
                       )
                      (next v3)
                      )
                )
                (call "{3}" ("error" "") []) ; will trigger an error
                )
               (next v2)
               )
              )
        (next v1)
       )
 )
  (call "{4}" ("" "") [%last_error%])
  )
  (call "{5}" ("" "") ["last_peer"])
  )
 )
