SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Figure 10: An example case of bCC where the completion-then-rewriting method successfully fixes the potential bug. The bCC instance is based on HumanEval/11. The model completion for the buggy prefix is representative.
Figure 11: An example case of bCC, where the rewriting-then-completion method successfully fixes the potential bug. The bCC instance is based on HumanEval/0.
Problem specification
```
```
Check if in given list of numbers, are any two numbers closer to each other than given threshold.
>>> has_close_elements([1.0, 2.0, 3.0], 0.5)
False
>>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)
True
```
```
Prefix with potential bugs
from typing import List
def has_close_elements(numbers:
    List[float], threshold: float)
-> bool:
    for idx, elem in enumerate(numbers):
        for idx2, elem2 in enumerate(numbers):
            if idx == idx2:
                return True
            return False
Figure 12: A success case of buggy-code completion. The model manages to generate a functionally correct completion by surpassing the potential bug (highlighted) by a continue command. The completions are from CODEGEN-2B-MONO on HumanEval/0 from buggy-HumanEval.