

def constant_number():
    return 42

def constant_true():
    return True


def constant_false():
    return False


def unary_sub():
    return -1


def unary_add():
    return +1


def equals(vals):
    def constraint(x, y):
        return (x == y) ^ (x != y)

    return all([constraint(x, y)
                for x in vals
                for y in vals])


def use_break(limit):
    for x in range(limit):
        break
    return x


def use_continue(limit):
    for x in range(limit):
        continue
    return x


def trigger_infinite_loop():
    # When `break` becomes `continue`, this should enter an infinite loop. This
    # helps us test timeouts.
    while True:
        break



def constant_number():
    return 42

def constant_true():
    return True


def constant_false():
    return False


def unary_sub():
    return -1


def unary_add():
    return +1


def equals(vals):
    def constraint(x, y):
        return (x == y) ^ (x != y)

    return all([constraint(x, y)
                for x in vals
                for y in vals])


def use_break(limit):
    for x in range(limit):
        break
    return x


def use_continue(limit):
    for x in range(limit):
        continue
    return x


def trigger_infinite_loop():
    # When `break` becomes `continue`, this should enter an infinite loop. This
    # helps us test timeouts.
    # Any object which isn't None passes the truth value testing so here
    # we use `while object()` instead of `while True` b/c the later becomes
    # `while False` when BooleanReplacer is applied and we don't trigger an
    # infinite loop.
    while object():
        break

Modify the infinite loop function
Modify the infinite loop function

Don't use `while True` b/c BooleanReplacer breaks this function's
test. This is a bit ugly but until Issue #97 is fixed there is
no other way around it.

  
  
  def constant_number():
      return 42
  
  def constant_true():
      return True
  
  
  def constant_false():
      return False
  
  
  def unary_sub():
      return -1
  
  
  def unary_add():
      return +1
  
  
  def equals(vals):
      def constraint(x, y):
          return (x == y) ^ (x != y)
  
      return all([constraint(x, y)
                  for x in vals
                  for y in vals])
  
  
  def use_break(limit):
      for x in range(limit):
          break
      return x
  
  
  def use_continue(limit):
      for x in range(limit):
          continue
      return x
  
  
  def trigger_infinite_loop():
      # When `break` becomes `continue`, this should enter an infinite loop. This
      # helps us test timeouts.
-     while True:
+     # Any object which isn't None passes the truth value testing so here
+     # we use `while object()` instead of `while True` b/c the later becomes
+     # `while False` when BooleanReplacer is applied and we don't trigger an
+     # infinite loop.
+     while object():
          break
  
Modify the infinite loop function
## Code Before:


def constant_number():
    return 42

def constant_true():
    return True


def constant_false():
    return False


def unary_sub():
    return -1


def unary_add():
    return +1


def equals(vals):
    def constraint(x, y):
        return (x == y) ^ (x != y)

    return all([constraint(x, y)
                for x in vals
                for y in vals])


def use_break(limit):
    for x in range(limit):
        break
    return x


def use_continue(limit):
    for x in range(limit):
        continue
    return x


def trigger_infinite_loop():
    # When `break` becomes `continue`, this should enter an infinite loop. This
    # helps us test timeouts.
    while True:
        break

## Instruction:
Modify the infinite loop function
## Code After:


def constant_number():
    return 42

def constant_true():
    return True


def constant_false():
    return False


def unary_sub():
    return -1


def unary_add():
    return +1


def equals(vals):
    def constraint(x, y):
        return (x == y) ^ (x != y)

    return all([constraint(x, y)
                for x in vals
                for y in vals])


def use_break(limit):
    for x in range(limit):
        break
    return x


def use_continue(limit):
    for x in range(limit):
        continue
    return x


def trigger_infinite_loop():
    # When `break` becomes `continue`, this should enter an infinite loop. This
    # helps us test timeouts.
    # Any object which isn't None passes the truth value testing so here
    # we use `while object()` instead of `while True` b/c the later becomes
    # `while False` when BooleanReplacer is applied and we don't trigger an
    # infinite loop.
    while object():
        break
