Dataset Viewer
Auto-converted to Parquet Duplicate
input
stringlengths
784
2.03k
output
stringlengths
16
864
id
stringlengths
11
13
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
balance = 0 for op in operations: balance += op if balance < 0: return True return False
HumanEval/3
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
mean = sum(numbers) / len(numbers) return sum(abs(x - mean) for x in numbers) / len(numbers)
HumanEval/4
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if not numbers: return [] result = [] for n in numbers[:-1]: result.append(n) result.append(delimeter) result.append(numbers[-1]) return result
HumanEval/5
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
def parse_paren_group(s): depth = 0 max_depth = 0 for c in s: if c == '(': depth += 1 max_depth = max(depth, max_depth) else: depth -= 1 return max_depth return [parse_paren_group(x) for x in paren_string.s...
HumanEval/6
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return [x for x in strings if substring in x]
HumanEval/7
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
sum_value = 0 prod_value = 1 for n in numbers: sum_value += n prod_value *= n return sum_value, prod_value
HumanEval/8
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
running_max = None result = [] for n in numbers: if running_max is None: running_max = n else: running_max = max(running_max, n) result.append(running_max) return result
HumanEval/9
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if not string: return '' beginning_of_suffix = 0 while not is_palindrome(string[beginning_of_suffix:]): beginning_of_suffix += 1 return string + string[:beginning_of_suffix][::-1]
HumanEval/10
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
def xor(i, j): if i == j: return '0' else: return '1' return ''.join(xor(x, y) for x, y in zip(a, b))
HumanEval/11
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if not strings: return None maxlen = max(len(x) for x in strings) for s in strings: if len(s) == maxlen: return s
HumanEval/12
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
while b: a, b = b, a % b return a
HumanEval/13
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
result = [] for i in range(len(string)): result.append(string[:i+1]) return result
HumanEval/14
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return ' '.join([str(x) for x in range(n + 1)])
HumanEval/15
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return len(set(string.lower()))
HumanEval/16
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
note_map = {'o': 4, 'o|': 2, '.|': 1} return [note_map[x] for x in music_string.split(' ') if x]
HumanEval/17
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
times = 0 for i in range(len(string) - len(substring) + 1): if string[i:i+len(substring)] == substring: times += 1 return times
HumanEval/18
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
value_map = { 'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9 } return ' '.join(sorted([x for x in numbers.split(' ') if x], key=lambda x: value_map[x]))
HumanEval/19
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
closest_pair = None distance = None for idx, elem in enumerate(numbers): for idx2, elem2 in enumerate(numbers): if idx != idx2: if distance is None: distance = abs(elem - elem2) closest_pair = tuple(sorted([elem, elem2])) ...
HumanEval/20
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
min_number = min(numbers) max_number = max(numbers) return [(x - min_number) / (max_number - min_number) for x in numbers]
HumanEval/21
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return [x for x in values if isinstance(x, int)]
HumanEval/22
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return len(string)
HumanEval/23
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
for i in reversed(range(n)): if n % i == 0: return i
HumanEval/24
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
import math fact = [] i = 2 while i <= int(math.sqrt(n) + 1): if n % i == 0: fact.append(i) n //= i else: i += 1 if n > 1: fact.append(n) return fact
HumanEval/25
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
import collections c = collections.Counter(numbers) return [n for n in numbers if c[n] <= 1]
HumanEval/26
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return string.swapcase()
HumanEval/27
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return ''.join(strings)
HumanEval/28
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return [x for x in strings if x.startswith(prefix)]
HumanEval/29
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return [e for e in l if e > 0]
HumanEval/30
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if n < 2: return False for k in range(2, n - 1): if n % k == 0: return False return True
HumanEval/31
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
begin, end = -1., 1. while poly(xs, begin) * poly(xs, end) > 0: begin *= 2.0 end *= 2.0 while end - begin > 1e-10: center = (begin + end) / 2.0 if poly(xs, center) * poly(xs, begin) > 0: begin = center else: end = center return begin
HumanEval/32
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
l = list(l) l[::3] = sorted(l[::3]) return l
HumanEval/33
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return sorted(list(set(l)))
HumanEval/34
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
m = l[0] for e in l: if e > m: m = e return m
HumanEval/35
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
ns = [] for i in range(n): if i % 11 == 0 or i % 13 == 0: ns.append(i) s = ''.join(list(map(str, ns))) ans = 0 for c in s: ans += (c == '7') return ans
HumanEval/36
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
evens = l[::2] odds = l[1::2] evens.sort() ans = [] for e, o in zip(evens, odds): ans.extend([e, o]) if len(evens) > len(odds): ans.append(evens[-1]) return ans
HumanEval/37
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return encode_cyclic(encode_cyclic(s))
HumanEval/38
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
import math def is_prime(p): if p < 2: return False for k in range(2, min(int(math.sqrt(p)) + 1, p - 1)): if p % k == 0: return False return True f = [0, 1] while True: f.append(f[-1] + f[-2]) if is_prime(f[-1]): ...
HumanEval/39
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
for i in range(len(l)): for j in range(i + 1, len(l)): for k in range(j + 1, len(l)): if l[i] + l[j] + l[k] == 0: return True return False
HumanEval/40
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return n**2
HumanEval/41
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return [(e + 1) for e in l]
HumanEval/42
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
for i, l1 in enumerate(l): for j in range(i + 1, len(l)): if l1 + l[j] == 0: return True return False
HumanEval/43
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
ret = "" while x > 0: ret = str(x % base) + ret x //= base return ret
HumanEval/44
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return a * h / 2.0
HumanEval/45
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
results = [0, 0, 2, 0] if n < 4: return results[n] for _ in range(4, n + 1): results.append(results[-1] + results[-2] + results[-3] + results[-4]) results.pop(0) return results[-1]
HumanEval/46
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
l = sorted(l) if len(l) % 2 == 1: return l[len(l) // 2] else: return (l[len(l) // 2 - 1] + l[len(l) // 2]) / 2.0
HumanEval/47
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
for i in range(len(text)): if text[i] != text[len(text) - 1 - i]: return False return True
HumanEval/48
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
ret = 1 for i in range(n): ret = (2 * ret) % p return ret
HumanEval/49
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return "".join([chr(((ord(ch) - 5 - ord("a")) % 26) + ord("a")) for ch in s])
HumanEval/50
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return "".join([s for s in text if s.lower() not in ["a", "e", "i", "o", "u"]])
HumanEval/51
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
for e in l: if e >= t: return False return True
HumanEval/52
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return x + y
HumanEval/53
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return set(s0) == set(s1)
HumanEval/54
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if n == 0: return 0 if n == 1: return 1 return fib(n - 1) + fib(n - 2)
HumanEval/55
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
depth = 0 for b in brackets: if b == "<": depth += 1 else: depth -= 1 if depth < 0: return False return depth == 0
HumanEval/56
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if l == sorted(l) or l == sorted(l, reverse=True): return True return False
HumanEval/57
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
ret = set() for e1 in l1: for e2 in l2: if e1 == e2: ret.add(e1) return sorted(list(ret))
HumanEval/58
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
def is_prime(k): if k < 2: return False for i in range(2, k - 1): if k % i == 0: return False return True largest = 1 for j in range(2, n + 1): if n % j == 0 and is_prime(j): largest = max(largest, j) return largest
HumanEval/59
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return sum(range(n + 1))
HumanEval/60
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 0: return False return depth == 0
HumanEval/61
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return [(i * x) for i, x in enumerate(xs)][1:]
HumanEval/62
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if n == 0: return 0 if n == 1: return 0 if n == 2: return 1 return fibfib(n - 1) + fibfib(n - 2) + fibfib(n - 3)
HumanEval/63
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1 return n_vowels
HumanEval/64
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
s = str(x) if shift > len(s): return s[::-1] else: return s[len(s) - shift:] + s[:len(s) - shift]
HumanEval/65
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if s == "": return 0 return sum(ord(char) if char.isupper() else 0 for char in s)
HumanEval/66
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
lis = list() for i in s.split(' '): if i.isdigit(): lis.append(int(i)) return n - sum(lis)
HumanEval/67
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if(len(arr) == 0): return [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): return [] return [min(evens), arr.index(min(evens))]
HumanEval/68
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
frq = [0] * (max(lst) + 1) for i in lst: frq[i] += 1; ans = -1 for i in range(1, len(frq)): if frq[i] >= i: ans = i return ans
HumanEval/69
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1]) switch = not switch return res
HumanEval/70
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if a + b <= c or a + c <= b or b + c <= a: return -1 s = (a + b + c)/2 area = (s * (s - a) * (s - b) * (s - c)) ** 0.5 area = round(area, 2) return area
HumanEval/71
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if sum(q) > w: return False i, j = 0, len(q)-1 while i<j: if q[i] != q[j]: return False i+=1 j-=1 return True
HumanEval/72
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
ans = 0 for i in range(len(arr) // 2): if arr[i] != arr[len(arr) - i - 1]: ans += 1 return ans
HumanEval/73
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
l1 = 0 for st in lst1: l1 += len(st) l2 = 0 for st in lst2: l2 += len(st) if l1 <= l2: return lst1 else: return lst2
HumanEval/74
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
def is_prime(n): for j in range(2,n): if n%j == 0: return False return True for i in range(2,101): if not is_prime(i): continue for j in range(2,101): if not is_prime(j): continue for k in range(2,101): if not i...
HumanEval/75
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if (n == 1): return (x == 1) power = 1 while (power < x): power = power * n return (power == x)
HumanEval/76
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
a = abs(a) return int(round(a ** (1. / 3))) ** 3 == a
HumanEval/77
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
primes = ('2', '3', '5', '7', 'B', 'D') total = 0 for i in range(0, len(num)): if num[i] in primes: total += 1 return total
HumanEval/78
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return "db" + bin(decimal)[2:] + "db"
HumanEval/79
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if len(s) < 3: return False for i in range(len(s) - 2): if s[i] == s[i+1] or s[i+1] == s[i+2] or s[i] == s[i+2]: return False return True
HumanEval/80
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
letter_grade = [] for gpa in grades: if gpa == 4.0: letter_grade.append("A+") elif gpa > 3.7: letter_grade.append("A") elif gpa > 3.3: letter_grade.append("A-") elif gpa > 3.0: letter_grade.append("B+") elif gpa > 2.7: ...
HumanEval/81
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
l = len(string) if l == 0 or l == 1: return False for i in range(2, l): if l % i == 0: return False return True
HumanEval/82
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if n == 1: return 1 return 18 * (10 ** (n - 2))
HumanEval/83
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return bin(sum(int(i) for i in str(N)))[2:]
HumanEval/84
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return sum([lst[i] for i in range(1, len(lst), 2) if lst[i]%2 == 0])
HumanEval/85
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return ' '.join([''.join(sorted(list(i))) for i in s.split(' ')])
HumanEval/86
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
coords = [(i, j) for i in range(len(lst)) for j in range(len(lst[i])) if lst[i][j] == x] return sorted(sorted(coords, key=lambda x: x[1], reverse=True), key=lambda x: x[0])
HumanEval/87
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return [] if len(array) == 0 else sorted(array, reverse= (array[0]+array[-1]) % 2 == 0)
HumanEval/88
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
d = 'abcdefghijklmnopqrstuvwxyz' out = '' for c in s: if c in d: out += d[(d.index(c)+2*2) % 26] else: out += c return out
HumanEval/89
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
lst = sorted(set(lst)) return None if len(lst) < 2 else lst[1]
HumanEval/90
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
import re sentences = re.split(r'[.?!]\s*', S) return sum(sentence[0:2] == 'I ' for sentence in sentences)
HumanEval/91
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if isinstance(x,int) and isinstance(y,int) and isinstance(z,int): if (x+y==z) or (x+z==y) or (y+z==x): return True return False return False
HumanEval/92
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
vowels = "aeiouAEIOU" vowels_replace = dict([(i, chr(ord(i) + 2)) for i in vowels]) message = message.swapcase() return ''.join([vowels_replace[i] if i in vowels else i for i in message])
HumanEval/93
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
def isPrime(n): for i in range(2,int(n**0.5)+1): if n%i==0: return False return True maxx = 0 i = 0 while i < len(lst): if(lst[i] > maxx and isPrime(lst[i])): maxx = lst[i] i+=1 result = sum(int(digit) for digit in str(maxx)) ...
HumanEval/94
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if len(dict.keys()) == 0: return False else: state = "start" for key in dict.keys(): if isinstance(key, str) == False: state = "mixed" break if state == "start": if key.isupper(): state = "upper"...
HumanEval/95
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
primes = [] for i in range(2, n): is_prime = True for j in range(2, i): if i % j == 0: is_prime = False break if is_prime: primes.append(i) return primes
HumanEval/96
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return abs(a % 10) * abs(b % 10)
HumanEval/97
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
count = 0 for i in range(0,len(s),2): if s[i] in "AEIOU": count += 1 return count
HumanEval/98
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
from math import floor, ceil if value.count('.') == 1: # remove trailing zeros while (value[-1] == '0'): value = value[:-1] num = float(value) if value[-2:] == '.5': if num > 0: res = ceil(num) else: res = floor(num) elif len(valu...
HumanEval/99
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
return [n + 2*i for i in range(n)]
HumanEval/100
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if not s: return [] s_list = [] for letter in s: if letter == ',': s_list.append(' ') else: s_list.append(letter) s_list = "".join(s_list) return s_list.split()
HumanEval/101
Answer the following question. Break down your reasoning process into small steps. Each step should represent a single, minimal reasoning action, and each step must logically follow the previous one. Use the following format for each step: Step i: [Your reasoning process in one cohesive response] After completing al...
if x > y: return -1 if y % 2 == 0: return y if x == y: return -1 return y - 1
HumanEval/102
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
95