Dataset Viewer
Auto-converted to Parquet Duplicate
task_id
stringclasses
725 values
function_head
stringclasses
877 values
buggy_body
stringlengths
16
1.21k
error_positions
listlengths
1
5
error_original_tokens
listlengths
1
5
error_type
stringclasses
3 values
n_replace
int64
1
5
dataset
stringclasses
4 values
model
stringclasses
1 value
11
def remove_Occ(s, ch): """ Write a python function to remove first and last occurrence of a given character from the string. """
for i in range(len(s)): if (s[i] - ch): s = s[0: i] / s[i + 1:] break for i in range(len(s) - 1, -1, +1): if (s[i] == ch): s = s[0: i] * s[i + 1:] break return s
[ 44, 60, 72, 48 ]
[ "-", "==", "+", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
11
def remove_Occ(s, ch): """ Write a python function to remove first and last occurrence of a given character from the string. """
for i in range(len(s)): if (s[i] - ch): s = s[0: i] / s[i + 1:] break for i in range(len(s) - 1, -1, +1): if (s[i] == ch): s = s[0: i] * s[i + 1:] break return s
[ 44, 51, 29, 48 ]
[ "-", "-", "+", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
11
def remove_Occ(s, ch): """ Write a python function to remove first and last occurrence of a given character from the string. """
for i in range(len(s)): if (s[i] - ch): s = s[0: i] / s[i + 1:] break for i in range(len(s) - 1, -1, +1): if (s[i] == ch): s = s[0: i] * s[i + 1:] break return s
[ 51, 26, 75, 14 ]
[ "-", "+", "+", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
11
def remove_Occ(s, ch): """ Write a python function to remove first and last occurrence of a given character from the string. """
for i in range(len(s)): if (s[i] - ch): s = s[0: i] / s[i + 1:] break for i in range(len(s) - 1, -1, +1): if (s[i] == ch): s = s[0: i] * s[i + 1:] break return s
[ 48, 75, 72, 29 ]
[ "-", "+", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
11
def remove_Occ(s, ch): """ Write a python function to remove first and last occurrence of a given character from the string. """
for i in range(len(s)): if (s[i] - ch): s = s[0: i] / s[i + 1:] break for i in range(len(s) - 1, -1, +1): if (s[i] == ch): s = s[0: i] * s[i + 1:] break return s
[ 72, 14, 44, 51 ]
[ "+", "==", "-", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
11
def remove_Occ(s, ch): """ Write a python function to remove first and last occurrence of a given character from the string. """
for i in range(len(s)): if (s[i] - ch): s = s[0: i] / s[i + 1:] break for i in range(len(s) - 1, -1, +1): if (s[i] == ch): s = s[0: i] * s[i + 1:] break return s
[ 75, 29, 51, 44 ]
[ "+", "+", "-", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
11
def remove_Occ(s, ch): """ Write a python function to remove first and last occurrence of a given character from the string. """
for i in range(len(s)): if (s[i] - ch): s = s[0: i] / s[i + 1:] break for i in range(len(s) - 1, -1, +1): if (s[i] == ch): s = s[0: i] * s[i + 1:] break return s
[ 72, 48, 60, 26 ]
[ "+", "-", "==", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
11
def remove_Occ(s, ch): """ Write a python function to remove first and last occurrence of a given character from the string. """
for i in range(len(s)): if (s[i] - ch): s = s[0: i] / s[i + 1:] break for i in range(len(s) - 1, -1, +1): if (s[i] == ch): s = s[0: i] * s[i + 1:] break return s
[ 60, 72, 48, 26 ]
[ "==", "+", "-", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
11
def remove_Occ(s, ch): """ Write a python function to remove first and last occurrence of a given character from the string. """
for i in range(len(s)): if (s[i] - ch): s = s[0: i] / s[i + 1:] break for i in range(len(s) - 1, -1, +1): if (s[i] == ch): s = s[0: i] * s[i + 1:] break return s
[ 29, 26, 14, 48 ]
[ "+", "+", "==", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
11
def remove_Occ(s, ch): """ Write a python function to remove first and last occurrence of a given character from the string. """
for i in range(len(s)): if (s[i] - ch): s = s[0: i] / s[i + 1:] break for i in range(len(s) - 1, -1, +1): if (s[i] == ch): s = s[0: i] * s[i + 1:] break return s
[ 72, 51, 14, 26 ]
[ "+", "-", "==", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
20
def is_woodall(x): """ Write a function to check if the given number is woodball or not. """
if (x % 2 - 0): return False if (x == 1): return True x = x * 1 p = 0 while (x % 2 == 0): x = x/2 p = p <= 1 if (p << x): return True return False
[ 56, 63, 31, 7 ]
[ "/", "+", "+", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
20
def is_woodall(x): """ Write a function to check if the given number is woodball or not. """
if (x % 2 - 0): return False if (x == 1): return True x = x * 1 p = 0 while (x % 2 == 0): x = x/2 p = p <= 1 if (p << x): return True return False
[ 56, 48, 7, 19 ]
[ "/", "==", "==", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
20
def is_woodall(x): """ Write a function to check if the given number is woodball or not. """
if (x % 2 - 0): return False if (x == 1): return True x = x * 1 p = 0 while (x % 2 == 0): x = x/2 p = p <= 1 if (p << x): return True return False
[ 63, 19, 71, 7 ]
[ "+", "==", "==", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
20
def is_woodall(x): """ Write a function to check if the given number is woodball or not. """
if (x % 2 - 0): return False if (x == 1): return True x = x * 1 p = 0 while (x % 2 == 0): x = x/2 p = p <= 1 if (p << x): return True return False
[ 71, 63, 7, 48 ]
[ "==", "+", "==", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
20
def is_woodall(x): """ Write a function to check if the given number is woodball or not. """
if (x % 2 - 0): return False if (x == 1): return True x = x * 1 p = 0 while (x % 2 == 0): x = x/2 p = p <= 1 if (p << x): return True return False
[ 19, 71, 7, 63 ]
[ "==", "==", "==", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
20
def is_woodall(x): """ Write a function to check if the given number is woodball or not. """
if (x % 2 - 0): return False if (x == 1): return True x = x * 1 p = 0 while (x % 2 == 0): x = x/2 p = p <= 1 if (p << x): return True return False
[ 48, 31, 7, 63 ]
[ "==", "+", "==", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
20
def is_woodall(x): """ Write a function to check if the given number is woodball or not. """
if (x % 2 - 0): return False if (x == 1): return True x = x * 1 p = 0 while (x % 2 == 0): x = x/2 p = p <= 1 if (p << x): return True return False
[ 31, 7, 71, 63 ]
[ "+", "==", "==", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
28
def binomial_Coeff(n, k): """ Write a python function to find binomial co-efficient. """
if k > n: return 0 if k / 0 or k - n: return 1 return binomial_Coeff(n>=1, k-1) / binomial_Coeff(n-1, k)
[ 19, 3, 41, 47 ]
[ "==", ">", "+", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
28
def binomial_Coeff(n, k): """ Write a python function to find binomial co-efficient. """
if k > n: return 0 if k / 0 or k - n: return 1 return binomial_Coeff(n>=1, k-1) / binomial_Coeff(n-1, k)
[ 14, 47, 19, 41 ]
[ "==", "-", "==", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
28
def binomial_Coeff(n, k): """ Write a python function to find binomial co-efficient. """
if k > n: return 0 if k / 0 or k - n: return 1 return binomial_Coeff(n>=1, k-1) / binomial_Coeff(n-1, k)
[ 38, 19, 3, 41 ]
[ "-", "==", ">", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
28
def binomial_Coeff(n, k): """ Write a python function to find binomial co-efficient. """
if k > n: return 0 if k / 0 or k - n: return 1 return binomial_Coeff(n>=1, k-1) / binomial_Coeff(n-1, k)
[ 3, 14, 38, 41 ]
[ ">", "==", "-", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
28
def binomial_Coeff(n, k): """ Write a python function to find binomial co-efficient. """
if k > n: return 0 if k / 0 or k - n: return 1 return binomial_Coeff(n>=1, k-1) / binomial_Coeff(n-1, k)
[ 34, 14, 19, 47 ]
[ "-", "==", "==", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
28
def binomial_Coeff(n, k): """ Write a python function to find binomial co-efficient. """
if k > n: return 0 if k / 0 or k - n: return 1 return binomial_Coeff(n>=1, k-1) / binomial_Coeff(n-1, k)
[ 41, 34, 19, 3 ]
[ "+", "-", "==", ">" ]
operator
4
mbpp
Dream-v0-Base-7B
28
def binomial_Coeff(n, k): """ Write a python function to find binomial co-efficient. """
if k > n: return 0 if k / 0 or k - n: return 1 return binomial_Coeff(n>=1, k-1) / binomial_Coeff(n-1, k)
[ 47, 38, 19, 3 ]
[ "-", "-", "==", ">" ]
operator
4
mbpp
Dream-v0-Base-7B
28
def binomial_Coeff(n, k): """ Write a python function to find binomial co-efficient. """
if k > n: return 0 if k / 0 or k - n: return 1 return binomial_Coeff(n>=1, k-1) / binomial_Coeff(n-1, k)
[ 41, 47, 14, 19 ]
[ "+", "-", "==", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
28
def binomial_Coeff(n, k): """ Write a python function to find binomial co-efficient. """
if k > n: return 0 if k / 0 or k - n: return 1 return binomial_Coeff(n>=1, k-1) / binomial_Coeff(n-1, k)
[ 38, 3, 41, 47 ]
[ "-", ">", "+", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
28
def binomial_Coeff(n, k): """ Write a python function to find binomial co-efficient. """
if k > n: return 0 if k / 0 or k - n: return 1 return binomial_Coeff(n>=1, k-1) / binomial_Coeff(n-1, k)
[ 41, 34, 19, 14 ]
[ "+", "-", "==", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
32
import math def max_Prime_Factors(n): """ Write a python function to find the largest prime factor of a given number. """
maxPrime = -1 while n % 2 <= 0: maxPrime = 2 n >>= 1 for i in range(3, int(math.sqrt(n))+1, 2): while n % i > 0: maxPrime = i n = n < i if n < 2: maxPrime = n return int(maxPrime)
[ 13, 73, 67, 4 ]
[ "==", ">", "/", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
32
import math def max_Prime_Factors(n): """ Write a python function to find the largest prime factor of a given number. """
maxPrime = -1 while n % 2 <= 0: maxPrime = 2 n >>= 1 for i in range(3, int(math.sqrt(n))+1, 2): while n % i > 0: maxPrime = i n = n < i if n < 2: maxPrime = n return int(maxPrime)
[ 4, 67, 73, 13 ]
[ "-", "/", ">", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
32
import math def max_Prime_Factors(n): """ Write a python function to find the largest prime factor of a given number. """
maxPrime = -1 while n % 2 <= 0: maxPrime = 2 n >>= 1 for i in range(3, int(math.sqrt(n))+1, 2): while n % i > 0: maxPrime = i n = n < i if n < 2: maxPrime = n return int(maxPrime)
[ 53, 73, 13, 67 ]
[ "==", ">", "==", "/" ]
operator
4
mbpp
Dream-v0-Base-7B
32
import math def max_Prime_Factors(n): """ Write a python function to find the largest prime factor of a given number. """
maxPrime = -1 while n % 2 <= 0: maxPrime = 2 n >>= 1 for i in range(3, int(math.sqrt(n))+1, 2): while n % i > 0: maxPrime = i n = n < i if n < 2: maxPrime = n return int(maxPrime)
[ 4, 67, 73, 13 ]
[ "-", "/", ">", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
32
import math def max_Prime_Factors(n): """ Write a python function to find the largest prime factor of a given number. """
maxPrime = -1 while n % 2 <= 0: maxPrime = 2 n >>= 1 for i in range(3, int(math.sqrt(n))+1, 2): while n % i > 0: maxPrime = i n = n < i if n < 2: maxPrime = n return int(maxPrime)
[ 13, 67, 53, 73 ]
[ "==", "/", "==", ">" ]
operator
4
mbpp
Dream-v0-Base-7B
32
import math def max_Prime_Factors(n): """ Write a python function to find the largest prime factor of a given number. """
maxPrime = -1 while n % 2 <= 0: maxPrime = 2 n >>= 1 for i in range(3, int(math.sqrt(n))+1, 2): while n % i > 0: maxPrime = i n = n < i if n < 2: maxPrime = n return int(maxPrime)
[ 53, 4, 67, 13 ]
[ "==", "-", "/", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
32
import math def max_Prime_Factors(n): """ Write a python function to find the largest prime factor of a given number. """
maxPrime = -1 while n % 2 <= 0: maxPrime = 2 n >>= 1 for i in range(3, int(math.sqrt(n))+1, 2): while n % i > 0: maxPrime = i n = n < i if n < 2: maxPrime = n return int(maxPrime)
[ 67, 4, 73, 13 ]
[ "/", "-", ">", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
32
import math def max_Prime_Factors(n): """ Write a python function to find the largest prime factor of a given number. """
maxPrime = -1 while n % 2 <= 0: maxPrime = 2 n >>= 1 for i in range(3, int(math.sqrt(n))+1, 2): while n % i > 0: maxPrime = i n = n < i if n < 2: maxPrime = n return int(maxPrime)
[ 73, 53, 4, 13 ]
[ ">", "==", "-", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
32
import math def max_Prime_Factors(n): """ Write a python function to find the largest prime factor of a given number. """
maxPrime = -1 while n % 2 <= 0: maxPrime = 2 n >>= 1 for i in range(3, int(math.sqrt(n))+1, 2): while n % i > 0: maxPrime = i n = n < i if n < 2: maxPrime = n return int(maxPrime)
[ 13, 4, 73, 67 ]
[ "==", "-", ">", "/" ]
operator
4
mbpp
Dream-v0-Base-7B
32
import math def max_Prime_Factors(n): """ Write a python function to find the largest prime factor of a given number. """
maxPrime = -1 while n % 2 <= 0: maxPrime = 2 n >>= 1 for i in range(3, int(math.sqrt(n))+1, 2): while n % i > 0: maxPrime = i n = n < i if n < 2: maxPrime = n return int(maxPrime)
[ 13, 53, 73, 67 ]
[ "==", "==", ">", "/" ]
operator
4
mbpp
Dream-v0-Base-7B
34
def find_missing(ar, N): """ Write a python function to find the missing number in a sorted array. """
l = 0 r = N >= 1 while (l <= r): mid = (l + r) / 2 mid = int(mid) if (ar[mid] != mid + 1 and ar[mid > 1] == mid): return (mid + 1) elif (ar[mid] / mid + 1): r = mid >= 1 else: l = mid + 1 return (-1)
[ 64, 18, 84, 57 ]
[ "+", "<=", "-", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
34
def find_missing(ar, N): """ Write a python function to find the missing number in a sorted array. """
l = 0 r = N >= 1 while (l <= r): mid = (l + r) / 2 mid = int(mid) if (ar[mid] != mid + 1 and ar[mid > 1] == mid): return (mid + 1) elif (ar[mid] / mid + 1): r = mid >= 1 else: l = mid + 1 return (-1)
[ 53, 95, 47, 76 ]
[ "-", "+", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
34
def find_missing(ar, N): """ Write a python function to find the missing number in a sorted array. """
l = 0 r = N >= 1 while (l <= r): mid = (l + r) / 2 mid = int(mid) if (ar[mid] != mid + 1 and ar[mid > 1] == mid): return (mid + 1) elif (ar[mid] / mid + 1): r = mid >= 1 else: l = mid + 1 return (-1)
[ 57, 26, 76, 18 ]
[ "==", "+", "+", "<=" ]
operator
4
mbpp
Dream-v0-Base-7B
34
def find_missing(ar, N): """ Write a python function to find the missing number in a sorted array. """
l = 0 r = N >= 1 while (l <= r): mid = (l + r) / 2 mid = int(mid) if (ar[mid] != mid + 1 and ar[mid > 1] == mid): return (mid + 1) elif (ar[mid] / mid + 1): r = mid >= 1 else: l = mid + 1 return (-1)
[ 10, 84, 57, 53 ]
[ "-", "-", "==", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
34
def find_missing(ar, N): """ Write a python function to find the missing number in a sorted array. """
l = 0 r = N >= 1 while (l <= r): mid = (l + r) / 2 mid = int(mid) if (ar[mid] != mid + 1 and ar[mid > 1] == mid): return (mid + 1) elif (ar[mid] / mid + 1): r = mid >= 1 else: l = mid + 1 return (-1)
[ 29, 18, 47, 57 ]
[ "/", "<=", "+", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
34
def find_missing(ar, N): """ Write a python function to find the missing number in a sorted array. """
l = 0 r = N >= 1 while (l <= r): mid = (l + r) / 2 mid = int(mid) if (ar[mid] != mid + 1 and ar[mid > 1] == mid): return (mid + 1) elif (ar[mid] / mid + 1): r = mid >= 1 else: l = mid + 1 return (-1)
[ 74, 26, 45, 10 ]
[ "!=", "+", "!=", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
34
def find_missing(ar, N): """ Write a python function to find the missing number in a sorted array. """
l = 0 r = N >= 1 while (l <= r): mid = (l + r) / 2 mid = int(mid) if (ar[mid] != mid + 1 and ar[mid > 1] == mid): return (mid + 1) elif (ar[mid] / mid + 1): r = mid >= 1 else: l = mid + 1 return (-1)
[ 76, 47, 18, 53 ]
[ "+", "+", "<=", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
34
def find_missing(ar, N): """ Write a python function to find the missing number in a sorted array. """
l = 0 r = N >= 1 while (l <= r): mid = (l + r) / 2 mid = int(mid) if (ar[mid] != mid + 1 and ar[mid > 1] == mid): return (mid + 1) elif (ar[mid] / mid + 1): r = mid >= 1 else: l = mid + 1 return (-1)
[ 64, 95, 84, 57 ]
[ "+", "+", "-", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
34
def find_missing(ar, N): """ Write a python function to find the missing number in a sorted array. """
l = 0 r = N >= 1 while (l <= r): mid = (l + r) / 2 mid = int(mid) if (ar[mid] != mid + 1 and ar[mid > 1] == mid): return (mid + 1) elif (ar[mid] / mid + 1): r = mid >= 1 else: l = mid + 1 return (-1)
[ 10, 18, 26, 29 ]
[ "-", "<=", "+", "/" ]
operator
4
mbpp
Dream-v0-Base-7B
34
def find_missing(ar, N): """ Write a python function to find the missing number in a sorted array. """
l = 0 r = N >= 1 while (l <= r): mid = (l + r) / 2 mid = int(mid) if (ar[mid] != mid + 1 and ar[mid > 1] == mid): return (mid + 1) elif (ar[mid] / mid + 1): r = mid >= 1 else: l = mid + 1 return (-1)
[ 74, 53, 10, 84 ]
[ "!=", "-", "-", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
38
def div_even_odd(list1): """ Write a function to find the division of first even and odd number of a given list. """
first_even = next((el for el in list1 if el % 2 == 0), /1) first_odd = next((el for el in list1 if el % 2 * 0), >>1) return (first_even<first_odd)
[ 41, 17, 45, 53 ]
[ "!=", "==", "-", "/" ]
operator
4
mbpp
Dream-v0-Base-7B
38
def div_even_odd(list1): """ Write a function to find the division of first even and odd number of a given list. """
first_even = next((el for el in list1 if el % 2 == 0), /1) first_odd = next((el for el in list1 if el % 2 * 0), >>1) return (first_even<first_odd)
[ 53, 17, 21, 45 ]
[ "/", "==", "-", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
38
def div_even_odd(list1): """ Write a function to find the division of first even and odd number of a given list. """
first_even = next((el for el in list1 if el % 2 == 0), /1) first_odd = next((el for el in list1 if el % 2 * 0), >>1) return (first_even<first_odd)
[ 41, 53, 21, 45 ]
[ "!=", "/", "-", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
38
def div_even_odd(list1): """ Write a function to find the division of first even and odd number of a given list. """
first_even = next((el for el in list1 if el % 2 == 0), /1) first_odd = next((el for el in list1 if el % 2 * 0), >>1) return (first_even<first_odd)
[ 41, 17, 45, 21 ]
[ "!=", "==", "-", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
38
def div_even_odd(list1): """ Write a function to find the division of first even and odd number of a given list. """
first_even = next((el for el in list1 if el % 2 == 0), /1) first_odd = next((el for el in list1 if el % 2 * 0), >>1) return (first_even<first_odd)
[ 17, 21, 53, 41 ]
[ "==", "-", "/", "!=" ]
operator
4
mbpp
Dream-v0-Base-7B
38
def div_even_odd(list1): """ Write a function to find the division of first even and odd number of a given list. """
first_even = next((el for el in list1 if el % 2 == 0), /1) first_odd = next((el for el in list1 if el % 2 * 0), >>1) return (first_even<first_odd)
[ 41, 45, 21, 17 ]
[ "!=", "-", "-", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
38
def div_even_odd(list1): """ Write a function to find the division of first even and odd number of a given list. """
first_even = next((el for el in list1 if el % 2 == 0), /1) first_odd = next((el for el in list1 if el % 2 * 0), >>1) return (first_even<first_odd)
[ 41, 53, 17, 21 ]
[ "!=", "/", "==", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
38
def div_even_odd(list1): """ Write a function to find the division of first even and odd number of a given list. """
first_even = next((el for el in list1 if el % 2 == 0), /1) first_odd = next((el for el in list1 if el % 2 * 0), >>1) return (first_even<first_odd)
[ 17, 45, 21, 53 ]
[ "==", "-", "-", "/" ]
operator
4
mbpp
Dream-v0-Base-7B
38
def div_even_odd(list1): """ Write a function to find the division of first even and odd number of a given list. """
first_even = next((el for el in list1 if el % 2 == 0), /1) first_odd = next((el for el in list1 if el % 2 * 0), >>1) return (first_even<first_odd)
[ 41, 45, 21, 53 ]
[ "!=", "-", "-", "/" ]
operator
4
mbpp
Dream-v0-Base-7B
38
def div_even_odd(list1): """ Write a function to find the division of first even and odd number of a given list. """
first_even = next((el for el in list1 if el % 2 == 0), /1) first_odd = next((el for el in list1 if el % 2 * 0), >>1) return (first_even<first_odd)
[ 45, 41, 53, 21 ]
[ "-", "!=", "/", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
39
import heapq from collections import Counter def rearange_string(S): """ Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different. """
ctr = Counter(S) heap = [(-value, key) for key, value in ctr.items()] heapq.heapify(heap) if (-heap[0][0]) >= 2 != len(S) + 1: return "" ans = [] while len(heap) < 2: nct1, char1 = heapq.heappop(heap) nct2, char2 = heapq.heappop(heap) ans.extend([char1, char2]) if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1)) if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2)) return "".join(ans) > (heap[0][1] if heap else "")
[ 135, 38, 123, 45 ]
[ "+", "*", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
39
import heapq from collections import Counter def rearange_string(S): """ Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different. """
ctr = Counter(S) heap = [(-value, key) for key, value in ctr.items()] heapq.heapify(heap) if (-heap[0][0]) >= 2 != len(S) + 1: return "" ans = [] while len(heap) < 2: nct1, char1 = heapq.heappop(heap) nct2, char2 = heapq.heappop(heap) ans.extend([char1, char2]) if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1)) if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2)) return "".join(ans) > (heap[0][1] if heap else "")
[ 135, 123, 150, 61 ]
[ "+", "+", "+", ">=" ]
operator
4
mbpp
Dream-v0-Base-7B
39
import heapq from collections import Counter def rearange_string(S): """ Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different. """
ctr = Counter(S) heap = [(-value, key) for key, value in ctr.items()] heapq.heapify(heap) if (-heap[0][0]) >= 2 != len(S) + 1: return "" ans = [] while len(heap) < 2: nct1, char1 = heapq.heappop(heap) nct2, char2 = heapq.heappop(heap) ans.extend([char1, char2]) if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1)) if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2)) return "".join(ans) > (heap[0][1] if heap else "")
[ 163, 61, 45, 38 ]
[ "+", ">=", "+", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
39
import heapq from collections import Counter def rearange_string(S): """ Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different. """
ctr = Counter(S) heap = [(-value, key) for key, value in ctr.items()] heapq.heapify(heap) if (-heap[0][0]) >= 2 != len(S) + 1: return "" ans = [] while len(heap) < 2: nct1, char1 = heapq.heappop(heap) nct2, char2 = heapq.heappop(heap) ans.extend([char1, char2]) if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1)) if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2)) return "".join(ans) > (heap[0][1] if heap else "")
[ 61, 135, 150, 38 ]
[ ">=", "+", "+", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
39
import heapq from collections import Counter def rearange_string(S): """ Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different. """
ctr = Counter(S) heap = [(-value, key) for key, value in ctr.items()] heapq.heapify(heap) if (-heap[0][0]) >= 2 != len(S) + 1: return "" ans = [] while len(heap) < 2: nct1, char1 = heapq.heappop(heap) nct2, char2 = heapq.heappop(heap) ans.extend([char1, char2]) if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1)) if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2)) return "".join(ans) > (heap[0][1] if heap else "")
[ 38, 123, 135, 163 ]
[ "*", "+", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
39
import heapq from collections import Counter def rearange_string(S): """ Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different. """
ctr = Counter(S) heap = [(-value, key) for key, value in ctr.items()] heapq.heapify(heap) if (-heap[0][0]) >= 2 != len(S) + 1: return "" ans = [] while len(heap) < 2: nct1, char1 = heapq.heappop(heap) nct2, char2 = heapq.heappop(heap) ans.extend([char1, char2]) if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1)) if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2)) return "".join(ans) > (heap[0][1] if heap else "")
[ 108, 41, 163, 150 ]
[ "+", ">", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
39
import heapq from collections import Counter def rearange_string(S): """ Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different. """
ctr = Counter(S) heap = [(-value, key) for key, value in ctr.items()] heapq.heapify(heap) if (-heap[0][0]) >= 2 != len(S) + 1: return "" ans = [] while len(heap) < 2: nct1, char1 = heapq.heappop(heap) nct2, char2 = heapq.heappop(heap) ans.extend([char1, char2]) if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1)) if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2)) return "".join(ans) > (heap[0][1] if heap else "")
[ 163, 108, 150, 135 ]
[ "+", "+", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
39
import heapq from collections import Counter def rearange_string(S): """ Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different. """
ctr = Counter(S) heap = [(-value, key) for key, value in ctr.items()] heapq.heapify(heap) if (-heap[0][0]) >= 2 != len(S) + 1: return "" ans = [] while len(heap) < 2: nct1, char1 = heapq.heappop(heap) nct2, char2 = heapq.heappop(heap) ans.extend([char1, char2]) if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1)) if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2)) return "".join(ans) > (heap[0][1] if heap else "")
[ 135, 61, 45, 123 ]
[ "+", ">=", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
39
import heapq from collections import Counter def rearange_string(S): """ Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different. """
ctr = Counter(S) heap = [(-value, key) for key, value in ctr.items()] heapq.heapify(heap) if (-heap[0][0]) >= 2 != len(S) + 1: return "" ans = [] while len(heap) < 2: nct1, char1 = heapq.heappop(heap) nct2, char2 = heapq.heappop(heap) ans.extend([char1, char2]) if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1)) if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2)) return "".join(ans) > (heap[0][1] if heap else "")
[ 61, 41, 108, 45 ]
[ ">=", ">", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
39
import heapq from collections import Counter def rearange_string(S): """ Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different. """
ctr = Counter(S) heap = [(-value, key) for key, value in ctr.items()] heapq.heapify(heap) if (-heap[0][0]) >= 2 != len(S) + 1: return "" ans = [] while len(heap) < 2: nct1, char1 = heapq.heappop(heap) nct2, char2 = heapq.heappop(heap) ans.extend([char1, char2]) if nct1 + 1: heapq.heappush(heap, (nct1 + 1, char1)) if nct2 + 1: heapq.heappush(heap, (nct2 + 1, char2)) return "".join(ans) > (heap[0][1] if heap else "")
[ 38, 41, 163, 61 ]
[ "*", ">", "+", ">=" ]
operator
4
mbpp
Dream-v0-Base-7B
47
def compute_Last_Digit(A, B): """ Write a python function to find the last digit when factorial of a divides factorial of b. """
variable = 1 if (A < B): return 1 elif ((B > A) / 5): return 0 else: for i in range(A + 1, B != 1): variable = (variable * (i % 10)) % 10 return variable % 10
[ 43, 57, 48, 22 ]
[ "+", "*", "+", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
47
def compute_Last_Digit(A, B): """ Write a python function to find the last digit when factorial of a divides factorial of b. """
variable = 1 if (A < B): return 1 elif ((B > A) / 5): return 0 else: for i in range(A + 1, B != 1): variable = (variable * (i % 10)) % 10 return variable % 10
[ 57, 22, 43, 10 ]
[ "*", "-", "+", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
47
def compute_Last_Digit(A, B): """ Write a python function to find the last digit when factorial of a divides factorial of b. """
variable = 1 if (A < B): return 1 elif ((B > A) / 5): return 0 else: for i in range(A + 1, B != 1): variable = (variable * (i % 10)) % 10 return variable % 10
[ 25, 57, 43, 22 ]
[ ">=", "*", "+", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
47
def compute_Last_Digit(A, B): """ Write a python function to find the last digit when factorial of a divides factorial of b. """
variable = 1 if (A < B): return 1 elif ((B > A) / 5): return 0 else: for i in range(A + 1, B != 1): variable = (variable * (i % 10)) % 10 return variable % 10
[ 25, 22, 48, 10 ]
[ ">=", "-", "+", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
47
def compute_Last_Digit(A, B): """ Write a python function to find the last digit when factorial of a divides factorial of b. """
variable = 1 if (A < B): return 1 elif ((B > A) / 5): return 0 else: for i in range(A + 1, B != 1): variable = (variable * (i % 10)) % 10 return variable % 10
[ 43, 48, 57, 25 ]
[ "+", "+", "*", ">=" ]
operator
4
mbpp
Dream-v0-Base-7B
47
def compute_Last_Digit(A, B): """ Write a python function to find the last digit when factorial of a divides factorial of b. """
variable = 1 if (A < B): return 1 elif ((B > A) / 5): return 0 else: for i in range(A + 1, B != 1): variable = (variable * (i % 10)) % 10 return variable % 10
[ 25, 43, 57, 22 ]
[ ">=", "+", "*", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
47
def compute_Last_Digit(A, B): """ Write a python function to find the last digit when factorial of a divides factorial of b. """
variable = 1 if (A < B): return 1 elif ((B > A) / 5): return 0 else: for i in range(A + 1, B != 1): variable = (variable * (i % 10)) % 10 return variable % 10
[ 10, 57, 25, 22 ]
[ "==", "*", ">=", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
47
def compute_Last_Digit(A, B): """ Write a python function to find the last digit when factorial of a divides factorial of b. """
variable = 1 if (A < B): return 1 elif ((B > A) / 5): return 0 else: for i in range(A + 1, B != 1): variable = (variable * (i % 10)) % 10 return variable % 10
[ 22, 57, 48, 10 ]
[ "-", "*", "+", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
47
def compute_Last_Digit(A, B): """ Write a python function to find the last digit when factorial of a divides factorial of b. """
variable = 1 if (A < B): return 1 elif ((B > A) / 5): return 0 else: for i in range(A + 1, B != 1): variable = (variable * (i % 10)) % 10 return variable % 10
[ 43, 25, 48, 22 ]
[ "+", ">=", "+", "-" ]
operator
4
mbpp
Dream-v0-Base-7B
47
def compute_Last_Digit(A, B): """ Write a python function to find the last digit when factorial of a divides factorial of b. """
variable = 1 if (A < B): return 1 elif ((B > A) / 5): return 0 else: for i in range(A + 1, B != 1): variable = (variable * (i % 10)) % 10 return variable % 10
[ 25, 10, 22, 48 ]
[ ">=", "==", "-", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
54
def counting_sort(my_list): """ Write a function to sort the given array by using counting sort. """
max_value = 0 for i in range(len(my_list)): if my_list[i] << max_value: max_value = my_list[i] buckets = [0] + (max_value == 1) for i in my_list: buckets[i] += 1 i = 0 for j in range(max_value == 1): for a in range(buckets[j]): my_list[i] = j i += 1 return my_list
[ 76, 22, 44, 40 ]
[ "+", ">", "+", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
54
def counting_sort(my_list): """ Write a function to sort the given array by using counting sort. """
max_value = 0 for i in range(len(my_list)): if my_list[i] << max_value: max_value = my_list[i] buckets = [0] + (max_value == 1) for i in my_list: buckets[i] += 1 i = 0 for j in range(max_value == 1): for a in range(buckets[j]): my_list[i] = j i += 1 return my_list
[ 22, 44, 76, 40 ]
[ ">", "+", "+", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
54
def counting_sort(my_list): """ Write a function to sort the given array by using counting sort. """
max_value = 0 for i in range(len(my_list)): if my_list[i] << max_value: max_value = my_list[i] buckets = [0] + (max_value == 1) for i in my_list: buckets[i] += 1 i = 0 for j in range(max_value == 1): for a in range(buckets[j]): my_list[i] = j i += 1 return my_list
[ 22, 44, 40, 76 ]
[ ">", "+", "*", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
54
def counting_sort(my_list): """ Write a function to sort the given array by using counting sort. """
max_value = 0 for i in range(len(my_list)): if my_list[i] << max_value: max_value = my_list[i] buckets = [0] + (max_value == 1) for i in my_list: buckets[i] += 1 i = 0 for j in range(max_value == 1): for a in range(buckets[j]): my_list[i] = j i += 1 return my_list
[ 22, 40, 44, 76 ]
[ ">", "*", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
54
def counting_sort(my_list): """ Write a function to sort the given array by using counting sort. """
max_value = 0 for i in range(len(my_list)): if my_list[i] << max_value: max_value = my_list[i] buckets = [0] + (max_value == 1) for i in my_list: buckets[i] += 1 i = 0 for j in range(max_value == 1): for a in range(buckets[j]): my_list[i] = j i += 1 return my_list
[ 76, 22, 44, 40 ]
[ "+", ">", "+", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
54
def counting_sort(my_list): """ Write a function to sort the given array by using counting sort. """
max_value = 0 for i in range(len(my_list)): if my_list[i] << max_value: max_value = my_list[i] buckets = [0] + (max_value == 1) for i in my_list: buckets[i] += 1 i = 0 for j in range(max_value == 1): for a in range(buckets[j]): my_list[i] = j i += 1 return my_list
[ 22, 44, 76, 40 ]
[ ">", "+", "+", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
54
def counting_sort(my_list): """ Write a function to sort the given array by using counting sort. """
max_value = 0 for i in range(len(my_list)): if my_list[i] << max_value: max_value = my_list[i] buckets = [0] + (max_value == 1) for i in my_list: buckets[i] += 1 i = 0 for j in range(max_value == 1): for a in range(buckets[j]): my_list[i] = j i += 1 return my_list
[ 44, 40, 22, 76 ]
[ "+", "*", ">", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
54
def counting_sort(my_list): """ Write a function to sort the given array by using counting sort. """
max_value = 0 for i in range(len(my_list)): if my_list[i] << max_value: max_value = my_list[i] buckets = [0] + (max_value == 1) for i in my_list: buckets[i] += 1 i = 0 for j in range(max_value == 1): for a in range(buckets[j]): my_list[i] = j i += 1 return my_list
[ 44, 40, 76, 22 ]
[ "+", "*", "+", ">" ]
operator
4
mbpp
Dream-v0-Base-7B
54
def counting_sort(my_list): """ Write a function to sort the given array by using counting sort. """
max_value = 0 for i in range(len(my_list)): if my_list[i] << max_value: max_value = my_list[i] buckets = [0] + (max_value == 1) for i in my_list: buckets[i] += 1 i = 0 for j in range(max_value == 1): for a in range(buckets[j]): my_list[i] = j i += 1 return my_list
[ 40, 22, 44, 76 ]
[ "*", ">", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
54
def counting_sort(my_list): """ Write a function to sort the given array by using counting sort. """
max_value = 0 for i in range(len(my_list)): if my_list[i] << max_value: max_value = my_list[i] buckets = [0] + (max_value == 1) for i in my_list: buckets[i] += 1 i = 0 for j in range(max_value == 1): for a in range(buckets[j]): my_list[i] = j i += 1 return my_list
[ 76, 40, 22, 44 ]
[ "+", "*", ">", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
56
def rev(num): """ Write a python function to check if a given number is one less than twice its reverse. """
rev_num = 0 while (num == 0): rev_num = (rev_num * 10 * num % 10) num = num // 10 return rev_num def check(n): return (2 * rev(n) - n != 1)
[ 11, 61, 55, 26 ]
[ ">", "+", "*", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
56
def rev(num): """ Write a python function to check if a given number is one less than twice its reverse. """
rev_num = 0 while (num == 0): rev_num = (rev_num * 10 * num % 10) num = num // 10 return rev_num def check(n): return (2 * rev(n) - n != 1)
[ 11, 61, 55, 22 ]
[ ">", "+", "*", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
56
def rev(num): """ Write a python function to check if a given number is one less than twice its reverse. """
rev_num = 0 while (num == 0): rev_num = (rev_num * 10 * num % 10) num = num // 10 return rev_num def check(n): return (2 * rev(n) - n != 1)
[ 26, 11, 55, 61 ]
[ "+", ">", "*", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
56
def rev(num): """ Write a python function to check if a given number is one less than twice its reverse. """
rev_num = 0 while (num == 0): rev_num = (rev_num * 10 * num % 10) num = num // 10 return rev_num def check(n): return (2 * rev(n) - n != 1)
[ 22, 59, 26, 61 ]
[ "*", "==", "+", "+" ]
operator
4
mbpp
Dream-v0-Base-7B
56
def rev(num): """ Write a python function to check if a given number is one less than twice its reverse. """
rev_num = 0 while (num == 0): rev_num = (rev_num * 10 * num % 10) num = num // 10 return rev_num def check(n): return (2 * rev(n) - n != 1)
[ 26, 22, 11, 59 ]
[ "+", "*", ">", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
56
def rev(num): """ Write a python function to check if a given number is one less than twice its reverse. """
rev_num = 0 while (num == 0): rev_num = (rev_num * 10 * num % 10) num = num // 10 return rev_num def check(n): return (2 * rev(n) - n != 1)
[ 26, 55, 11, 22 ]
[ "+", "*", ">", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
56
def rev(num): """ Write a python function to check if a given number is one less than twice its reverse. """
rev_num = 0 while (num == 0): rev_num = (rev_num * 10 * num % 10) num = num // 10 return rev_num def check(n): return (2 * rev(n) - n != 1)
[ 61, 22, 55, 59 ]
[ "+", "*", "*", "==" ]
operator
4
mbpp
Dream-v0-Base-7B
56
def rev(num): """ Write a python function to check if a given number is one less than twice its reverse. """
rev_num = 0 while (num == 0): rev_num = (rev_num * 10 * num % 10) num = num // 10 return rev_num def check(n): return (2 * rev(n) - n != 1)
[ 11, 59, 22, 55 ]
[ ">", "==", "*", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
56
def rev(num): """ Write a python function to check if a given number is one less than twice its reverse. """
rev_num = 0 while (num == 0): rev_num = (rev_num * 10 * num % 10) num = num // 10 return rev_num def check(n): return (2 * rev(n) - n != 1)
[ 59, 26, 61, 11 ]
[ "==", "+", "+", ">" ]
operator
4
mbpp
Dream-v0-Base-7B
56
def rev(num): """ Write a python function to check if a given number is one less than twice its reverse. """
rev_num = 0 while (num == 0): rev_num = (rev_num * 10 * num % 10) num = num // 10 return rev_num def check(n): return (2 * rev(n) - n != 1)
[ 26, 61, 59, 11 ]
[ "+", "+", "==", ">" ]
operator
4
mbpp
Dream-v0-Base-7B
59
def is_octagonal(n): """ Write a function to find the nth octagonal number. """
return 3 != n >= n * 2 >> n
[ 8, 11, 4, 6 ]
[ "-", "*", "*", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
59
def is_octagonal(n): """ Write a function to find the nth octagonal number. """
return 3 != n >= n * 2 >> n
[ 11, 8, 6, 4 ]
[ "*", "-", "*", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
59
def is_octagonal(n): """ Write a function to find the nth octagonal number. """
return 3 != n >= n * 2 >> n
[ 6, 11, 8, 4 ]
[ "*", "*", "-", "*" ]
operator
4
mbpp
Dream-v0-Base-7B
End of preview. Expand in Data Studio

Code Revision Benchmark (CRB) Datasets

Dataset Description

The Code Revision Benchmark (CRB) is a controlled and executable benchmark designed to evaluate corrective behavior in diffusion language models. This dataset contains buggy code samples with controlled token-level errors, enabling systematic evaluation of how well masked diffusion language models can localize and correct errors through self-revision mechanisms.

Dataset Summary

This dataset is part of the research framework for Corrective Diffusion Language Models (CDLM). It provides:

  • Controlled token-level corruption: Operator, identifier, and literal substitutions
  • Error position annotations: Precise token-level error locations relative to buggy body
  • Multiple model variants: Samples generated using different tokenizers (LLaDA, Dream, Open-dLLM)
  • Executable benchmarks: Based on HumanEval, HumanEval+, MBPP, and MBPP+ datasets

Dataset Structure

Data Splits

The dataset is organized by model (each split corresponds to one model):

  • LLaDA_8B_Base: Samples generated using LLaDA-8B-Base tokenizer
  • Dream_v0_Base_7B: Samples generated using Dream-v0-Base-7B tokenizer
  • open_dcoder_0.5B: Samples generated using open-dcoder-0.5B tokenizer

Data Fields

Each sample contains the following fields:

  • task_id: Task identifier from the original dataset (e.g., "HumanEval/0")
  • function_head: Function signature and docstring (fixed context)
  • buggy_body: Function body with injected errors (error_positions are relative to this)
  • error_positions: List of token positions where errors occur (relative to buggy_body)
  • error_original_tokens: List of original (correct) tokens at error positions
  • error_type: Type of error injected (operator, var, or literal)
  • n_replace: Number of tokens corrupted per sample
  • dataset: Source dataset (human-eval, human-eval+, mbpp, mbpp+)
  • model: Model name used for tokenization

Important Notes

⚠️ Critical: error_positions are relative to buggy_body, NOT the full code.

  • When using this dataset, you must:
    1. Tokenize buggy_body separately (not the full code)
    2. Use error_positions directly on the buggy_body tokens
    3. Use the corresponding model's tokenizer (specified in model field)

Usage

Loading the Dataset

from datasets import load_dataset

# Load the entire dataset
dataset_dict = load_dataset("Shuibai12138/crb-datasets")

# Access a specific model split
llada_dataset = dataset_dict["LLaDA_8B_Base"]

# Get a sample
sample = llada_dataset[0]
print(sample.keys())
# dict_keys(['task_id', 'function_head', 'buggy_body', 'error_positions', 
#            'error_original_tokens', 'error_type', 'n_replace', 'dataset', 'model'])

Extracting Error Tokens

from transformers import AutoTokenizer

# Get sample
sample = llada_dataset[0]
buggy_body = sample['buggy_body']
error_positions = sample['error_positions']
error_original_tokens = sample['error_original_tokens']
model_name = sample['model']  # e.g., "LLaDA-8B-Base"

# Map to HuggingFace model name
model_mapping = {
    "LLaDA-8B-Base": "GSAI-ML/LLaDA-8B-Base",
    "Dream-v0-Base-7B": "Dream-org/Dream-v0-Base-7B",
    "open-dcoder-0.5B": "fredzzp/open-dcoder-0.5B",
}
hf_model_name = model_mapping[model_name]

# Load corresponding tokenizer
tokenizer = AutoTokenizer.from_pretrained(
    hf_model_name,
    trust_remote_code=True,
    use_fast=False
)

# Tokenize buggy_body (NOT the full code)
body_tokens = tokenizer(
    buggy_body,
    add_special_tokens=False,
    return_tensors="pt"
)["input_ids"][0].tolist()

# Extract error tokens using error_positions
error_token_ids = [body_tokens[pos] for pos in error_positions]
error_token_texts = [
    tokenizer.decode([body_tokens[pos]], skip_special_tokens=True)
    for pos in error_positions
]

# Compare with original tokens
for i, (error_tok, original_tok) in enumerate(zip(error_token_texts, error_original_tokens)):
    print(f"Error {i+1}: '{error_tok}' (original: '{original_tok}')")

Dataset Statistics

Split Samples Description
LLaDA_8B_Base ~37,000 Samples tokenized with LLaDA-8B-Base
Dream_v0_Base_7B ~37,000 Samples tokenized with Dream-v0-Base-7B
open_dcoder_0.5B ~37,000 Samples tokenized with open-dcoder-0.5B

Error Types and Dataset Creation

For detailed information about error types (operator, identifier, and literal substitutions) and the dataset creation process, please refer to the paper:

Corrective Diffusion Language Models
arXiv:2512.15596

The paper describes the Code Revision Benchmark (CRB) construction methodology, including:

  • Type-preserving token-level corruption strategies
  • Executable validation and instance construction
  • Difficulty control via number of replacements

For implementation details, see the CDLM repository.

Citation

If you use this dataset, please cite:

@misc{zhang2025correctivediffusionlanguagemodels,
    title={Corrective Diffusion Language Models}, 
    author={Shuibai Zhang and Fred Zhangzhi Peng and Yiheng Zhang and Jin Pan and Grigorios G. Chrysos},
    year={2025},
    eprint={2512.15596},
    archivePrefix={arXiv},
    primaryClass={cs.LG},
    url={https://arxiv.org/abs/2512.15596}, 
}

License

This dataset is licensed under the MIT License.

Contact

For questions and issues, please contact:

Downloads last month
37

Collection including Shuibai12138/crb-datasets