code: def test_pause_to_forward(
      flow_tester, ops_factory, size_offset, forwarding
  ):
      ft = flow_tester(high=300, mid=200, low=100)
      ops = ops_factory()
  
      batch_test1 = [ops.op(op_type="inform", offset=201 + size_offset)]
      batch_test2 = [ops.op(size=50)]
  
      prep_pause(ft, ops)
  
      for op in batch_test1:
          ft.add(op)
          assert (
              ft.state == State.FORWARDING
              if forwarding
              else State.PAUSING
          )
      assert [] == ft.forwarded_ops
      assert [] == ft.written
      assert [] == ft.recovered
  
      for op in batch_test2:
          ft.add(op)
          assert (
              ft.state == State.FORWARDING
              if forwarding
              else State.PAUSING
          )
      assert batch_test2 == ft.written
      assert batch_test2 if forwarding else [] == ft.forwarded_ops
      assert ([] if forwarding else [(300, 350)]) == ft.recovered
  
imports: import json
  import time
  from dataclasses import dataclass
  from enum import Enum
  import pytest
  from wandb.proto import wandb_internal_pb2
  from wandb.sdk.internal import flow_control, settings_static
  from wandb.sdk.lib import proto_util
  from wandb.sdk.wandb_settings import Settings
label_desc: Use image node_id 5 for calling a global function with example usage: test_pause_to_forward(flow_tester, ops_factory, size_offset, forwarding) without return types