name
stringclasses
161 values
language
stringclasses
22 values
prompt
stringlengths
40
2.27k
doctests
stringclasses
3 values
original
stringclasses
956 values
prompt_terminology
stringclasses
2 values
tests
stringlengths
125
5.35k
stop_tokens
listlengths
1
7
HumanEval_35_max_element
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Return maximum element in the list. // >>> MaxElement((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) // (...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py
verbatim
} public static void Main(string[] args) { Debug.Assert(MaxElement((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) == (3L)); Debug.Assert(MaxElement((new List<long>(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)124L, (long)1L, (long)-10L})...
[ "\n }\n" ]
HumanEval_36_fizz_buzz
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13. // >>> FizzBuzz((5...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py
verbatim
} public static void Main(string[] args) { Debug.Assert(FizzBuzz((50L)) == (0L)); Debug.Assert(FizzBuzz((78L)) == (2L)); Debug.Assert(FizzBuzz((79L)) == (3L)); Debug.Assert(FizzBuzz((100L)) == (3L)); Debug.Assert(FizzBuzz((200L)) == (6L)); Debug.Assert(FizzBuzz((4000L)) == (192L)); D...
[ "\n }\n" ]
HumanEval_37_sort_even
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // This function takes a list l and returns a list l' such that // l' is identical to l in the odd indicies, while its values...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py
verbatim
} public static void Main(string[] args) { Debug.Assert(SortEven((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List<long>(new long[]{(long)1L, (long)2L, (long)3L})))); Debug.Assert(SortEven((new List<long>(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L,...
[ "\n }\n" ]
HumanEval_39_prime_fib
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // prime_fib returns n-th number that is a Fibonacci number and it's also prime. // >>> PrimeFib((1L)) // (2L) // >>>...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py
verbatim
} public static void Main(string[] args) { Debug.Assert(PrimeFib((1L)) == (2L)); Debug.Assert(PrimeFib((2L)) == (3L)); Debug.Assert(PrimeFib((3L)) == (5L)); Debug.Assert(PrimeFib((4L)) == (13L)); Debug.Assert(PrimeFib((5L)) == (89L)); Debug.Assert(PrimeFib((6L)) == (233L)); Debug.Ass...
[ "\n }\n" ]
HumanEval_3_below_zero
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // You're given a list of deposit and withdrawal operations on a bank account that starts with // zero balance. Your task is ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py
verbatim
} public static void Main(string[] args) { Debug.Assert(BelowZero((new List<long>())) == (false)); Debug.Assert(BelowZero((new List<long>(new long[]{(long)1L, (long)2L, (long)-3L, (long)1L, (long)2L, (long)-3L}))) == (false)); Debug.Assert(BelowZero((new List<long>(new long[]{(long)1L, (long)2L, (lo...
[ "\n }\n" ]
HumanEval_40_triples_sum_to_zero
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // triples_sum_to_zero takes a list of integers as an input. // it returns True if there are three distinct elements in the l...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py
verbatim
} public static void Main(string[] args) { Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false)); Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)5L, (long)-1L}))) == (false)); Debug.Assert(TriplesSumToZero(...
[ "\n }\n" ]
HumanEval_41_car_race_collision
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Imagine a road that's a perfectly straight infinitely long line. // n cars are driving left to right; simultaneously, a d...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py
verbatim
} public static void Main(string[] args) { Debug.Assert(CarRaceCollision((2L)) == (4L)); Debug.Assert(CarRaceCollision((3L)) == (9L)); Debug.Assert(CarRaceCollision((4L)) == (16L)); Debug.Assert(CarRaceCollision((8L)) == (64L)); Debug.Assert(CarRaceCollision((10L)) == (100L)); } }
[ "\n }\n" ]
HumanEval_42_incr_list
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Return list with elements incremented by 1. // >>> IncrList((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py
verbatim
} public static void Main(string[] args) { Debug.Assert(IncrList((new List<long>())).Equals((new List<long>()))); Debug.Assert(IncrList((new List<long>(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List<long>(new long[]{(long)4L, (long)3L, (long)2L})))); Debug.Assert(IncrList((new List<lon...
[ "\n }\n" ]
HumanEval_43_pairs_sum_to_zero
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // pairs_sum_to_zero takes a list of integers as an input. // it returns True if there are two distinct elements in the list ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py
verbatim
} public static void Main(string[] args) { Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false)); Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (false)); Debug.Assert(PairsSumToZero((new L...
[ "\n }\n" ]
HumanEval_44_change_base
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Change numerical base of input number x to base. // return string representation after the conversion. // base numbers...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py
verbatim
} public static void Main(string[] args) { Debug.Assert(ChangeBase((8L), (3L)).Equals(("22"))); Debug.Assert(ChangeBase((9L), (3L)).Equals(("100"))); Debug.Assert(ChangeBase((234L), (2L)).Equals(("11101010"))); Debug.Assert(ChangeBase((16L), (2L)).Equals(("10000"))); Debug.Assert(ChangeBase(...
[ "\n }\n" ]
HumanEval_45_triangle_area
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Given length of a side and high return area for a triangle. // >>> TriangleArea((5L), (3L)) // (7.5f) // publi...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py
verbatim
} public static void Main(string[] args) { Debug.Assert(TriangleArea((5L), (3L)) == (7.5f)); Debug.Assert(TriangleArea((2L), (2L)) == (2.0f)); Debug.Assert(TriangleArea((10L), (8L)) == (40.0f)); } }
[ "\n }\n" ]
HumanEval_46_fib4
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: // fib4(0) -> 0 /...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Fib4((5L)) == (4L)); Debug.Assert(Fib4((8L)) == (28L)); Debug.Assert(Fib4((10L)) == (104L)); Debug.Assert(Fib4((12L)) == (386L)); } }
[ "\n }\n" ]
HumanEval_47_median
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Return median of elements in the list l. // >>> Median((new List<long>(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Median((new List<long>(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))) == (float)3L); Debug.Assert(Median((new List<long>(new long[]{(long)-10L, (long)4L, (long)6L, (long)1000L, (long)10L, (long)20L}))) == (8.0f)); Debug.Assert(...
[ "\n }\n" ]
HumanEval_48_is_palindrome
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Checks if given string is a palindrome // >>> IsPalindrome(("")) // (true) // >>> IsPalindrome(("aba")) // (tr...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py
verbatim
} public static void Main(string[] args) { Debug.Assert(IsPalindrome(("")) == (true)); Debug.Assert(IsPalindrome(("aba")) == (true)); Debug.Assert(IsPalindrome(("aaaaa")) == (true)); Debug.Assert(IsPalindrome(("zbcd")) == (false)); Debug.Assert(IsPalindrome(("xywyx")) == (true)); Debug.A...
[ "\n }\n" ]
HumanEval_49_modp
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Return 2^n modulo p (be aware of numerics). // >>> Modp((3L), (5L)) // (3L) // >>> Modp((1101L), (101L)) // (2...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Modp((3L), (5L)) == (3L)); Debug.Assert(Modp((1101L), (101L)) == (2L)); Debug.Assert(Modp((0L), (101L)) == (1L)); Debug.Assert(Modp((3L), (11L)) == (8L)); Debug.Assert(Modp((100L), (101L)) == (1L)); Debug.Assert(Modp((30L), (5L)) ==...
[ "\n }\n" ]
HumanEval_4_mean_absolute_deviation
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // For a given list of input numbers, calculate Mean Absolute Deviation // around the mean of this dataset. // Mean Absol...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py
verbatim
} public static void Main(string[] args) { Debug.Assert(MeanAbsoluteDeviation((new List<float>(new float[]{(float)1.0f, (float)2.0f}))) == (0.5f)); Debug.Assert(MeanAbsoluteDeviation((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f}))) == (1.0f)); Debug.Assert(MeanAbso...
[ "\n }\n" ]
HumanEval_51_remove_vowels
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // remove_vowels is a function that takes string and returns string without vowels. // >>> RemoveVowels(("")) // ("") ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py
verbatim
} public static void Main(string[] args) { Debug.Assert(RemoveVowels(("")).Equals((""))); Debug.Assert(RemoveVowels(("abcdef\nghijklm")).Equals(("bcdf\nghjklm"))); Debug.Assert(RemoveVowels(("fedcba")).Equals(("fdcb"))); Debug.Assert(RemoveVowels(("eeeee")).Equals((""))); Debug.Assert(Remove...
[ "\n }\n" ]
HumanEval_52_below_threshold
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Return True if all numbers in the list l are below threshold t. // >>> BelowThreshold((new List<long>(new long[]{(long)1L,...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py
verbatim
} public static void Main(string[] args) { Debug.Assert(BelowThreshold((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)10L})), (100L)) == (true)); Debug.Assert(BelowThreshold((new List<long>(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (5L)) == (false)); Debug.Assert(BelowT...
[ "\n }\n" ]
HumanEval_53_add
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Add two numbers x and y // >>> Add((2L), (3L)) // (5L) // >>> Add((5L), (7L)) // (12L) // public stati...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Add((0L), (1L)) == (1L)); Debug.Assert(Add((1L), (0L)) == (1L)); Debug.Assert(Add((2L), (3L)) == (5L)); Debug.Assert(Add((5L), (7L)) == (12L)); Debug.Assert(Add((7L), (5L)) == (12L)); } }
[ "\n }\n" ]
HumanEval_54_same_chars
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Check if two words have the same characters. // >>> SameChars(("eabcdzzzz"), ("dddzzzzzzzddeddabc")) // (true) // ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py
verbatim
} public static void Main(string[] args) { Debug.Assert(SameChars(("eabcdzzzz"), ("dddzzzzzzzddeddabc")) == (true)); Debug.Assert(SameChars(("abcd"), ("dddddddabc")) == (true)); Debug.Assert(SameChars(("dddddddabc"), ("abcd")) == (true)); Debug.Assert(SameChars(("eabcd"), ("dddddddabc")) == (fal...
[ "\n }\n" ]
HumanEval_55_fib
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Return n-th Fibonacci number. // >>> Fib((10L)) // (55L) // >>> Fib((1L)) // (1L) // >>> Fib((8L)) // ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Fib((10L)) == (55L)); Debug.Assert(Fib((1L)) == (1L)); Debug.Assert(Fib((8L)) == (21L)); Debug.Assert(Fib((11L)) == (89L)); Debug.Assert(Fib((12L)) == (144L)); } }
[ "\n }\n" ]
HumanEval_56_correct_bracketing
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // brackets is a string of "<" and ">". // return True if every opening bracket has a corresponding closing bracket. // >...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py
verbatim
} public static void Main(string[] args) { Debug.Assert(CorrectBracketing(("<>")) == (true)); Debug.Assert(CorrectBracketing(("<<><>>")) == (true)); Debug.Assert(CorrectBracketing(("<><><<><>><>")) == (true)); Debug.Assert(CorrectBracketing(("<><><<<><><>><>><<><><<>>>")) == (true)); Debug.A...
[ "\n }\n" ]
HumanEval_57_monotonic
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Return True is list elements are monotonically increasing or decreasing. // >>> Monotonic((new List<long>(new long[]{(long...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Monotonic((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)10L}))) == (true)); Debug.Assert(Monotonic((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)20L}))) == (true)); Debug.Assert(Monotonic((new List<long>(new lo...
[ "\n }\n" ]
HumanEval_58_common
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Return sorted unique common elements for two lists. // >>> Common((new List<long>(new long[]{(long)1L, (long)4L, (long)3L,...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Common((new List<long>(new long[]{(long)1L, (long)4L, (long)3L, (long)34L, (long)653L, (long)2L, (long)5L})), (new List<long>(new long[]{(long)5L, (long)7L, (long)1L, (long)5L, (long)9L, (long)653L, (long)121L}))).Equals((new List<long>(new long[]{(lon...
[ "\n }\n" ]
HumanEval_59_largest_prime_factor
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Return the largest prime factor of n. Assume n > 1 and is not a prime. // >>> LargestPrimeFactor((13195L)) // (29L) ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py
verbatim
} public static void Main(string[] args) { Debug.Assert(LargestPrimeFactor((15L)) == (5L)); Debug.Assert(LargestPrimeFactor((27L)) == (3L)); Debug.Assert(LargestPrimeFactor((63L)) == (7L)); Debug.Assert(LargestPrimeFactor((330L)) == (11L)); Debug.Assert(LargestPrimeFactor((13195L)) == (29L))...
[ "\n }\n" ]
HumanEval_5_intersperse
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Insert a number 'delimeter' between every two consecutive elements of input list `numbers' // >>> Intersperse((new List<lo...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Intersperse((new List<long>()), (7L)).Equals((new List<long>()))); Debug.Assert(Intersperse((new List<long>(new long[]{(long)5L, (long)6L, (long)3L, (long)2L})), (8L)).Equals((new List<long>(new long[]{(long)5L, (long)8L, (long)6L, (long)8L, (long)...
[ "\n }\n" ]
HumanEval_60_sum_to_n
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // sum_to_n is a function that sums numbers from 1 to n. // >>> SumToN((30L)) // (465L) // >>> SumToN((100L)) // ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py
verbatim
} public static void Main(string[] args) { Debug.Assert(SumToN((1L)) == (1L)); Debug.Assert(SumToN((6L)) == (21L)); Debug.Assert(SumToN((11L)) == (66L)); Debug.Assert(SumToN((30L)) == (465L)); Debug.Assert(SumToN((100L)) == (5050L)); } }
[ "\n }\n" ]
HumanEval_61_correct_bracketing
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // brackets is a string of "(" and ")". // return True if every opening bracket has a corresponding closing bracket. // >...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py
verbatim
} public static void Main(string[] args) { Debug.Assert(CorrectBracketing(("()")) == (true)); Debug.Assert(CorrectBracketing(("(()())")) == (true)); Debug.Assert(CorrectBracketing(("()()(()())()")) == (true)); Debug.Assert(CorrectBracketing(("()()((()()())())(()()(()))")) == (true)); Debug.A...
[ "\n }\n" ]
HumanEval_62_derivative
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // xs represent coefficients of a polynomial. // xs[0] + xs[1] * x + xs[2] * x^2 + .... // Return derivative of this poly...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Derivative((new List<long>(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))).Equals((new List<long>(new long[]{(long)1L, (long)4L, (long)12L, (long)20L})))); Debug.Assert(Derivative((new List<long>(new long[]{(long)1L, (long)2L, (long...
[ "\n }\n" ]
HumanEval_63_fibfib
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows: // fibfib(0) == 0 ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Fibfib((2L)) == (1L)); Debug.Assert(Fibfib((1L)) == (0L)); Debug.Assert(Fibfib((5L)) == (4L)); Debug.Assert(Fibfib((8L)) == (24L)); Debug.Assert(Fibfib((10L)) == (81L)); Debug.Assert(Fibfib((12L)) == (274L)); Debug.Assert(Fibfib...
[ "\n }\n" ]
HumanEval_64_vowels_count
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Write a function vowels_count which takes a string representing // a word as input and returns the number of vowels in the...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py
verbatim
} public static void Main(string[] args) { Debug.Assert(VowelsCount(("abcde")) == (2L)); Debug.Assert(VowelsCount(("Alone")) == (3L)); Debug.Assert(VowelsCount(("key")) == (2L)); Debug.Assert(VowelsCount(("bye")) == (1L)); Debug.Assert(VowelsCount(("keY")) == (2L)); Debug.Assert(VowelsCo...
[ "\n }\n" ]
HumanEval_65_circular_shift
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Circular shift the digits of the integer x, shift the digits right by shift // and return the result as a string. // I...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py
verbatim
} public static void Main(string[] args) { Debug.Assert(CircularShift((100L), (2L)).Equals(("001"))); Debug.Assert(CircularShift((12L), (2L)).Equals(("12"))); Debug.Assert(CircularShift((97L), (8L)).Equals(("79"))); Debug.Assert(CircularShift((12L), (1L)).Equals(("21"))); Debug.Assert(Circul...
[ "\n }\n" ]
HumanEval_66_digitSum
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Task // Write a function that takes a string as input and returns the sum of the upper characters only' // ASCII codes...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Digitsum(("")) == (0L)); Debug.Assert(Digitsum(("abAB")) == (131L)); Debug.Assert(Digitsum(("abcCd")) == (67L)); Debug.Assert(Digitsum(("helloE")) == (69L)); Debug.Assert(Digitsum(("woArBld")) == (131L)); Debug.Assert(Digitsum(("aAa...
[ "\n }\n" ]
HumanEval_67_fruit_distribution
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // In this task, you will be given a string that represents a number of apples and oranges // that are distributed in a bask...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py
verbatim
} public static void Main(string[] args) { Debug.Assert(FruitDistribution(("5 apples and 6 oranges"), (19L)) == (8L)); Debug.Assert(FruitDistribution(("5 apples and 6 oranges"), (21L)) == (10L)); Debug.Assert(FruitDistribution(("0 apples and 1 oranges"), (3L)) == (2L)); Debug.Assert(FruitDistrib...
[ "\n }\n" ]
HumanEval_68_pluck
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // "Given an array representing a branch of a tree that has non-negative integer nodes // your task is to pluck one of the no...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Pluck((new List<long>(new long[]{(long)4L, (long)2L, (long)3L}))).Equals((new List<long>(new long[]{(long)2L, (long)1L})))); Debug.Assert(Pluck((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List<long>(new long[]{(long)2L, ...
[ "\n }\n" ]
HumanEval_69_search
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // You are given a non-empty list of positive integers. Return the greatest integer that is greater than // zero, and has a ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Search((new List<long>(new long[]{(long)5L, (long)5L, (long)5L, (long)5L, (long)1L}))) == (1L)); Debug.Assert(Search((new List<long>(new long[]{(long)4L, (long)1L, (long)4L, (long)1L, (long)4L, (long)4L}))) == (4L)); Debug.Assert(Search((new Li...
[ "\n }\n" ]
HumanEval_6_parse_nested_parens
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Input to this function is a string represented multiple groups for nested parentheses separated by spaces. // For each of ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py
verbatim
} public static void Main(string[] args) { Debug.Assert(ParseNestedParens(("(()()) ((())) () ((())()())")).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)1L, (long)3L})))); Debug.Assert(ParseNestedParens(("() (()) ((())) (((())))")).Equals((new List<long>(new long[]{(long)1L, (long)2L, (lon...
[ "\n }\n" ]
HumanEval_70_strange_sort_list
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Given list of integers, return list in strange order. // Strange sorting, is when you start with the minimum value, //...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py
verbatim
} public static void Main(string[] args) { Debug.Assert(StrangeSortList((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List<long>(new long[]{(long)1L, (long)4L, (long)2L, (long)3L})))); Debug.Assert(StrangeSortList((new List<long>(new long[]{(long)5L, (long)6L, (long)7...
[ "\n }\n" ]
HumanEval_71_triangle_area
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Given the lengths of the three sides of a triangle. Return the area of // the triangle rounded to 2 decimal points if the ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py
verbatim
} public static void Main(string[] args) { Debug.Assert(TriangleArea((3L), (4L), (5L)) == (6.0f)); Debug.Assert(TriangleArea((1L), (2L), (10L)) == (float)-1L); Debug.Assert(TriangleArea((4L), (8L), (5L)) == (8.18f)); Debug.Assert(TriangleArea((2L), (2L), (2L)) == (1.73f)); Debug.Assert(Trian...
[ "\n }\n" ]
HumanEval_72_will_it_fly
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Write a function that returns True if the object q will fly, and False otherwise. // The object q will fly if it's balance...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py
verbatim
} public static void Main(string[] args) { Debug.Assert(WillItFly((new List<long>(new long[]{(long)3L, (long)2L, (long)3L})), (9L)) == (true)); Debug.Assert(WillItFly((new List<long>(new long[]{(long)1L, (long)2L})), (5L)) == (false)); Debug.Assert(WillItFly((new List<long>(new long[]{(long)3L})), (...
[ "\n }\n" ]
HumanEval_73_smallest_change
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Given an array arr of integers, find the minimum number of elements that // need to be changed to make the array palindrom...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py
verbatim
} public static void Main(string[] args) { Debug.Assert(SmallestChange((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)5L, (long)4L, (long)7L, (long)9L, (long)6L}))) == (4L)); Debug.Assert(SmallestChange((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)3L, (long)2L...
[ "\n }\n" ]
HumanEval_74_total_match
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Write a function that accepts two lists of strings and returns the list that has // total number of chars in the all stri...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py
verbatim
} public static void Main(string[] args) { Debug.Assert(TotalMatch((new List<string>()), (new List<string>())).Equals((new List<string>()))); Debug.Assert(TotalMatch((new List<string>(new string[]{(string)"hi", (string)"admin"})), (new List<string>(new string[]{(string)"hi", (string)"hi"}))).Equals((new...
[ "\n }\n" ]
HumanEval_75_is_multiply_prime
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Write a function that returns true if the given number is the multiplication of 3 prime numbers // and false otherwise. ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py
verbatim
} public static void Main(string[] args) { Debug.Assert(IsMultiplyPrime((5L)) == (false)); Debug.Assert(IsMultiplyPrime((30L)) == (true)); Debug.Assert(IsMultiplyPrime((8L)) == (true)); Debug.Assert(IsMultiplyPrime((10L)) == (false)); Debug.Assert(IsMultiplyPrime((125L)) == (true)); Debu...
[ "\n }\n" ]
HumanEval_76_is_simple_power
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Your task is to write a function that returns true if a number x is a simple // power of n and false in other cases. /...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py
verbatim
} public static void Main(string[] args) { Debug.Assert(IsSimplePower((16L), (2L)) == (true)); Debug.Assert(IsSimplePower((143214L), (16L)) == (false)); Debug.Assert(IsSimplePower((4L), (2L)) == (true)); Debug.Assert(IsSimplePower((9L), (3L)) == (true)); Debug.Assert(IsSimplePower((16L), (4L...
[ "\n }\n" ]
HumanEval_77_iscube
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Write a function that takes an integer a and returns True // if this ingeger is a cube of some integer number. // Not...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Iscube((1L)) == (true)); Debug.Assert(Iscube((2L)) == (false)); Debug.Assert(Iscube((-1L)) == (true)); Debug.Assert(Iscube((64L)) == (true)); Debug.Assert(Iscube((180L)) == (false)); Debug.Assert(Iscube((1000L)) == (true)); Debu...
[ "\n }\n" ]
HumanEval_78_hex_key
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // You have been tasked to write a function that receives // a hexadecimal number as a string and counts the number of hexad...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py
verbatim
} public static void Main(string[] args) { Debug.Assert(HexKey(("AB")) == (1L)); Debug.Assert(HexKey(("1077E")) == (2L)); Debug.Assert(HexKey(("ABED1A33")) == (4L)); Debug.Assert(HexKey(("2020")) == (2L)); Debug.Assert(HexKey(("123456789ABCDEF0")) == (6L)); Debug.Assert(HexKey(("11223344...
[ "\n }\n" ]
HumanEval_79_decimal_to_binary
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // You will be given a number in decimal form and your task is to convert it to // binary format. The function should return ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py
verbatim
} public static void Main(string[] args) { Debug.Assert(DecimalToBinary((0L)).Equals(("db0db"))); Debug.Assert(DecimalToBinary((32L)).Equals(("db100000db"))); Debug.Assert(DecimalToBinary((103L)).Equals(("db1100111db"))); Debug.Assert(DecimalToBinary((15L)).Equals(("db1111db"))); } }
[ "\n }\n" ]
HumanEval_7_filter_by_substring
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Filter an input list of strings only for ones that contain given substring // >>> FilterBySubstring((new List<string>()), ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py
verbatim
} public static void Main(string[] args) { Debug.Assert(FilterBySubstring((new List<string>()), ("john")).Equals((new List<string>()))); Debug.Assert(FilterBySubstring((new List<string>(new string[]{(string)"xxx", (string)"asd", (string)"xxy", (string)"john doe", (string)"xxxAAA", (string)"xxx"})), ("xx...
[ "\n }\n" ]
HumanEval_80_is_happy
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // You are given a string s. // Your task is to check if the string is happy or not. // A string is happy if its length i...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py
verbatim
} public static void Main(string[] args) { Debug.Assert(IsHappy(("a")) == (false)); Debug.Assert(IsHappy(("aa")) == (false)); Debug.Assert(IsHappy(("abcd")) == (true)); Debug.Assert(IsHappy(("aabb")) == (false)); Debug.Assert(IsHappy(("adb")) == (true)); Debug.Assert(IsHappy(("xyy")) == ...
[ "\n }\n" ]
HumanEval_81_numerical_letter_grade
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // It is the last week of the semester and the teacher has to give the grades // to students. The teacher has been making her...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py
verbatim
} public static void Main(string[] args) { Debug.Assert(NumericalLetterGrade((new List<float>(new float[]{(float)4.0f, (float)3L, (float)1.7f, (float)2L, (float)3.5f}))).Equals((new List<string>(new string[]{(string)"A+", (string)"B", (string)"C-", (string)"C", (string)"A-"})))); Debug.Assert(NumericalL...
[ "\n }\n" ]
HumanEval_82_prime_length
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Write a function that takes a string and returns True if the string // length is a prime number or False otherwise // ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py
verbatim
} public static void Main(string[] args) { Debug.Assert(PrimeLength(("Hello")) == (true)); Debug.Assert(PrimeLength(("abcdcba")) == (true)); Debug.Assert(PrimeLength(("kittens")) == (true)); Debug.Assert(PrimeLength(("orange")) == (false)); Debug.Assert(PrimeLength(("wow")) == (true)); D...
[ "\n }\n" ]
HumanEval_83_starts_one_ends
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Given a positive integer n, return the count of the numbers of n-digit // positive integers that start or end with 1. ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py
verbatim
} public static void Main(string[] args) { Debug.Assert(StartsOneEnds((1L)) == (1L)); Debug.Assert(StartsOneEnds((2L)) == (18L)); Debug.Assert(StartsOneEnds((3L)) == (180L)); Debug.Assert(StartsOneEnds((4L)) == (1800L)); Debug.Assert(StartsOneEnds((5L)) == (18000L)); } }
[ "\n }\n" ]
HumanEval_84_solve
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Given a positive integer N, return the total sum of its digits in binary. // Example // >>> Solve((1000L)) // ("1"...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Solve((1000L)).Equals(("1"))); Debug.Assert(Solve((150L)).Equals(("110"))); Debug.Assert(Solve((147L)).Equals(("1100"))); Debug.Assert(Solve((333L)).Equals(("1001"))); Debug.Assert(Solve((963L)).Equals(("10010"))); } }
[ "\n }\n" ]
HumanEval_85_add
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Given a non-empty list of integers lst. add the even elements that are at odd indices.. // Examples: // >>> Add((new L...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Add((new List<long>(new long[]{(long)4L, (long)88L}))) == (88L)); Debug.Assert(Add((new List<long>(new long[]{(long)4L, (long)5L, (long)6L, (long)7L, (long)2L, (long)122L}))) == (122L)); Debug.Assert(Add((new List<long>(new long[]{(long)4L, (lo...
[ "\n }\n" ]
HumanEval_86_anti_shuffle
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Write a function that takes a string and returns an ordered version of it. // Ordered version of string, is a string where...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py
verbatim
} public static void Main(string[] args) { Debug.Assert(AntiShuffle(("Hi")).Equals(("Hi"))); Debug.Assert(AntiShuffle(("hello")).Equals(("ehllo"))); Debug.Assert(AntiShuffle(("number")).Equals(("bemnru"))); Debug.Assert(AntiShuffle(("abcd")).Equals(("abcd"))); Debug.Assert(AntiShuffle(("Hell...
[ "\n }\n" ]
HumanEval_87_get_row
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // You are given a 2 dimensional data, as a nested lists, // which is similar to matrix, however, unlike matrices, // eac...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py
verbatim
} public static void Main(string[] args) { Debug.Assert(GetRow((new List<List<long>>(new List<long>[]{(List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List<...
[ "\n }\n" ]
HumanEval_88_sort_array
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Given an array of non-negative integers, return a copy of the given array after sorting, // you will sort the given array ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py
verbatim
} public static void Main(string[] args) { Debug.Assert(SortArray((new List<long>())).Equals((new List<long>()))); Debug.Assert(SortArray((new List<long>(new long[]{(long)5L}))).Equals((new List<long>(new long[]{(long)5L})))); Debug.Assert(SortArray((new List<long>(new long[]{(long)2L, (long)4L, (lo...
[ "\n }\n" ]
HumanEval_89_encrypt
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Create a function encrypt that takes a string as an argument and // returns a string encrypted with the alphabet being rot...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Encrypt(("hi")).Equals(("lm"))); Debug.Assert(Encrypt(("asdfghjkl")).Equals(("ewhjklnop"))); Debug.Assert(Encrypt(("gf")).Equals(("kj"))); Debug.Assert(Encrypt(("et")).Equals(("ix"))); Debug.Assert(Encrypt(("faewfawefaewg")).Equals(("je...
[ "\n }\n" ]
HumanEval_8_sum_product
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list. // Empty sum...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py
verbatim
} public static void Main(string[] args) { Debug.Assert(SumProduct((new List<long>())).Equals((Tuple.Create(0L, 1L)))); Debug.Assert(SumProduct((new List<long>(new long[]{(long)1L, (long)1L, (long)1L}))).Equals((Tuple.Create(3L, 1L)))); Debug.Assert(SumProduct((new List<long>(new long[]{(long)100L, ...
[ "\n }\n" ]
HumanEval_90_next_smallest
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // You are given a list of integers. // Write a function next_smallest() that returns the 2nd smallest element of the list. ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py
verbatim
} public static void Main(string[] args) { Debug.Assert(NextSmallest((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals(2L)); Debug.Assert(NextSmallest((new List<long>(new long[]{(long)5L, (long)1L, (long)4L, (long)3L, (long)2L}))).Equals(2L)); Debug.Assert(NextSm...
[ "\n }\n" ]
HumanEval_91_is_bored
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // You'll be given a string of words, and your task is to count the number // of boredoms. A boredom is a sentence that start...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py
verbatim
} public static void Main(string[] args) { Debug.Assert(IsBored(("Hello world")) == (0L)); Debug.Assert(IsBored(("Is the sky blue?")) == (0L)); Debug.Assert(IsBored(("I love It !")) == (1L)); Debug.Assert(IsBored(("bIt")) == (0L)); Debug.Assert(IsBored(("I feel good today. I will be producti...
[ "\n }\n" ]
HumanEval_92_any_int
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Create a function that takes 3 numbers. // Returns true if one of the numbers is equal to the sum of the other two, and al...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py
verbatim
} public static void Main(string[] args) { Debug.Assert(AnyInt((float)2L, (float)3L, (float)1L) == (true)); Debug.Assert(AnyInt((2.5f), (float)2L, (float)3L) == (false)); Debug.Assert(AnyInt((1.5f), (float)5L, (3.5f)) == (false)); Debug.Assert(AnyInt((float)2L, (float)6L, (float)2L) == (false));...
[ "\n }\n" ]
HumanEval_93_encode
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Write a function that takes a message, and encodes in such a // way that it swaps case of all letters, replaces all vowel...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Encode(("TEST")).Equals(("tgst"))); Debug.Assert(Encode(("Mudasir")).Equals(("mWDCSKR"))); Debug.Assert(Encode(("YES")).Equals(("ygs"))); Debug.Assert(Encode(("This is a message")).Equals(("tHKS KS C MGSSCGG"))); Debug.Assert(Encode(("I...
[ "\n }\n" ]
HumanEval_94_skjkasdkd
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // You are given a list of integers. // You need to find the largest prime value and return the sum of its digits. // Exa...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Skjkasdkd((new List<long>(new long[]{(long)0L, (long)3L, (long)2L, (long)1L, (long)3L, (long)5L, (long)7L, (long)4L, (long)5L, (long)5L, (long)5L, (long)2L, (long)181L, (long)32L, (long)4L, (long)32L, (long)3L, (long)2L, (long)32L, (long)324L, (long)4L...
[ "\n }\n" ]
HumanEval_95_check_dict_case
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Given a dictionary, return True if all keys are strings in lower // case or all keys are strings in upper case, else retu...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py
verbatim
} public static void Main(string[] args) { Debug.Assert(CheckDictCase((new Dictionary<string,string>(){{"p", "pineapple"}, {"b", "banana"}})) == (true)); Debug.Assert(CheckDictCase((new Dictionary<string,string>(){{"p", "pineapple"}, {"A", "banana"}, {"B", "banana"}})) == (false)); Debug.Assert(Chec...
[ "\n }\n" ]
HumanEval_96_count_up_to
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Implement a function that takes an non-negative integer and returns an array of the first n // integers that are prime num...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py
verbatim
} public static void Main(string[] args) { Debug.Assert(CountUpTo((5L)).Equals((new List<long>(new long[]{(long)2L, (long)3L})))); Debug.Assert(CountUpTo((6L)).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)5L})))); Debug.Assert(CountUpTo((7L)).Equals((new List<long>(new long[]{(long)2L...
[ "\n }\n" ]
HumanEval_97_multiply
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Complete the function that takes two integers and returns // the product of their unit digits. // Assume the input is...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py
verbatim
} public static void Main(string[] args) { Debug.Assert(Multiply((148L), (412L)) == (16L)); Debug.Assert(Multiply((19L), (28L)) == (72L)); Debug.Assert(Multiply((2020L), (1851L)) == (0L)); Debug.Assert(Multiply((14L), (-15L)) == (20L)); Debug.Assert(Multiply((76L), (67L)) == (42L)); Debu...
[ "\n }\n" ]
HumanEval_98_count_upper
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Given a string s, count the number of uppercase vowels in even indices. // For example: // >>> CountUpper(("aBCdEf")) ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py
verbatim
} public static void Main(string[] args) { Debug.Assert(CountUpper(("aBCdEf")) == (1L)); Debug.Assert(CountUpper(("abcdefg")) == (0L)); Debug.Assert(CountUpper(("dBBE")) == (0L)); Debug.Assert(CountUpper(("B")) == (0L)); Debug.Assert(CountUpper(("U")) == (1L)); Debug.Assert(CountUpper(("...
[ "\n }\n" ]
HumanEval_99_closest_integer
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // Create a function that takes a value (string) representing a number // and returns the closest integer to it. If the numbe...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py
verbatim
} public static void Main(string[] args) { Debug.Assert(ClosestInteger(("10")) == (10L)); Debug.Assert(ClosestInteger(("14.5")) == (15L)); Debug.Assert(ClosestInteger(("-15.5")) == (-16L)); Debug.Assert(ClosestInteger(("15.3")) == (15L)); Debug.Assert(ClosestInteger(("0")) == (0L)); } }...
[ "\n }\n" ]
HumanEval_9_rolling_max
cs
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // From a given list of integers, generate a list of rolling maximum element found until given moment // in the sequence. ...
transform
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py
verbatim
} public static void Main(string[] args) { Debug.Assert(RollingMax((new List<long>())).Equals((new List<long>()))); Debug.Assert(RollingMax((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})))); Debug.Asser...
[ "\n }\n" ]
HumanEval_0_has_close_elements
d
import std.math; /* 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 */ bool has_close_elements(float[] numbers, float threshold)
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_0_has_close_elements.py
verbatim
unittest { alias candidate = has_close_elements; assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == true); assert(candidate([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == false); assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == true); assert(candidate([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == false); ...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_100_make_a_pile
d
import std.math; /* Given a positive integer n, you have to make a pile of n levels of stones. The first level has n stones. The number of stones in the next level is: - the next odd number if n is odd. - the next even number if n is even. Return the number of stones in each level in a list, where element at in...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_100_make_a_pile.py
verbatim
unittest { alias candidate = make_a_pile; assert(candidate(3L) == [3L, 5L, 7L]); assert(candidate(4L) == [4L, 6L, 8L, 10L]); assert(candidate(5L) == [5L, 7L, 9L, 11L, 13L]); assert(candidate(6L) == [6L, 8L, 10L, 12L, 14L, 16L]); assert(candidate(8L) == [8L, 10L, 12L, 14L, 16L, 18L, 20L, 22L]); ...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_101_words_string
d
import std.math; /* You will be given a string of words separated by commas or spaces. Your task is to split the string into words and return an array of the words. For example: words_string("Hi, my name is John") == ["Hi", "my", "name", "is", "John"] words_string("One, two, three, four, five, six") == ["One", "two", "...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_101_words_string.py
verbatim
unittest { alias candidate = words_string; assert(candidate("Hi, my name is John") == ["Hi", "my", "name", "is", "John"]); assert(candidate("One, two, three, four, five, six") == ["One", "two", "three", "four", "five", "six"]); assert(candidate("Hi, my name") == ["Hi", "my", "name"]); assert(candid...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_102_choose_num
d
import std.math; /* This function takes two positive numbers x and y and returns the biggest even integer number that is in the range [x, y] inclusive. If there's no such number, then the function should return -1. For example: choose_num(12, 15) = 14 choose_num(13, 12) = -1 */ long choose_num(long x, long y)
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_102_choose_num.py
verbatim
unittest { alias candidate = choose_num; assert(candidate(12L, 15L) == 14L); assert(candidate(13L, 12L) == -1L); assert(candidate(33L, 12354L) == 12354L); assert(candidate(5234L, 5233L) == -1L); assert(candidate(6L, 29L) == 28L); assert(candidate(27L, 10L) == -1L); assert(candidate(7L, ...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_104_unique_digits
d
import std.math; /* Given a list of positive integers x. return a sorted list of all elements that hasn't any even digit. Note: Returned list should be sorted in increasing order. For example: >>> unique_digits([15, 33, 1422, 1]) [1, 15, 33] >>> unique_digits([152, 323, 1422, 10]) [] */ long[] unique_digits(long[] x) ...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_104_unique_digits.py
verbatim
unittest { alias candidate = unique_digits; assert(candidate([15L, 33L, 1422L, 1L]) == [1L, 15L, 33L]); assert(candidate([152L, 323L, 1422L, 10L]) == []); assert(candidate([12345L, 2033L, 111L, 151L]) == [111L, 151L]); assert(candidate([135L, 103L, 31L]) == [31L, 135L]); } void main(){}
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_105_by_length
d
import std.math; /* Given an array of integers, sort the integers that are between 1 and 9 inclusive, reverse the resulting array, and then replace each digit by its corresponding name from "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine". For example: arr = [2, 1, 1, 4, 5, 8, 2, 3] -...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_105_by_length.py
verbatim
unittest { alias candidate = by_length; assert(candidate([2L, 1L, 1L, 4L, 5L, 8L, 2L, 3L]) == ["Eight", "Five", "Four", "Three", "Two", "Two", "One", "One"]); assert(candidate([]) == []); assert(candidate([1L, -1L, 55L]) == ["One"]); assert(candidate([1L, -1L, 3L, 2L]) == ["Three", "Two", "One"]); ...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_106_f
d
import std.math; /* Implement the function f that takes n as a parameter, and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even or the sum of numbers from 1 to i otherwise. i starts from 1. the factorial of i is the multiplication of the numbers from 1 to i (1 *...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_106_f.py
verbatim
unittest { alias candidate = f; assert(candidate(5L) == [1L, 2L, 6L, 24L, 15L]); assert(candidate(7L) == [1L, 2L, 6L, 24L, 15L, 720L, 28L]); assert(candidate(1L) == [1L]); assert(candidate(3L) == [1L, 2L, 6L]); } void main(){}
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_107_even_odd_palindrome
d
import std.math; import std.typecons; /* Given a positive integer n, return a tuple that has the number of even and odd integer palindromes that fall within the range(1, n), inclusive. Example 1: Input: 3 Output: (1, 2) Explanation: Integer palindrome are 1, 2, 3. one of them is even, and two of them ar...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_107_even_odd_palindrome.py
verbatim
unittest { alias candidate = even_odd_palindrome; assert(candidate(123L) == tuple(8L, 13L)); assert(candidate(12L) == tuple(4L, 6L)); assert(candidate(3L) == tuple(1L, 2L)); assert(candidate(63L) == tuple(6L, 8L)); assert(candidate(25L) == tuple(5L, 6L)); assert(candidate(19L) == tuple(4L, ...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_108_count_nums
d
import std.math; import std.typecons; /* Write a function count_nums which takes an array of integers and returns the number of elements which has a sum of digits > 0. If a number is negative, then its first signed digit will be negative: e.g. -123 has signed digits -1, 2, and 3. >>> count_nums([]) == 0 >>> count_nums(...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_108_count_nums.py
verbatim
unittest { alias candidate = count_nums; assert(candidate([]) == 0L); assert(candidate([-1L, -2L, 0L]) == 0L); assert(candidate([1L, 1L, 2L, -2L, 3L, 4L, 5L]) == 6L); assert(candidate([1L, 6L, 9L, -6L, 0L, 1L, 5L]) == 5L); assert(candidate([1L, 100L, 98L, -7L, 1L, -1L]) == 4L); assert(candi...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_109_move_one_ball
d
import std.math; import std.typecons; /* We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The numbers in the array will be randomly ordered. Your task is to determine if it is possible to get an array sorted in non-decreasing order by performing the following operation on the given array: You are a...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_109_move_one_ball.py
verbatim
unittest { alias candidate = move_one_ball; assert(candidate([3L, 4L, 5L, 1L, 2L]) == true); assert(candidate([3L, 5L, 10L, 1L, 2L]) == true); assert(candidate([4L, 3L, 1L, 2L]) == false); assert(candidate([3L, 5L, 4L, 1L, 2L]) == false); assert(candidate([]) == true); } void main(){}
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_10_make_palindrome
d
import std.math; import std.typecons; /* Find the shortest palindrome that begins with a supplied string. Algorithm idea is simple: - Find the longest postfix of supplied string that is a palindrome. - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix. >>> make_palindr...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_10_make_palindrome.py
verbatim
unittest { alias candidate = make_palindrome; assert(candidate("") == ""); assert(candidate("x") == "x"); assert(candidate("xyz") == "xyzyx"); assert(candidate("xyx") == "xyx"); assert(candidate("jerry") == "jerryrrej"); } void main(){}
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_110_exchange
d
import std.math; import std.typecons; /* In this problem, you will implement a function that takes two lists of numbers, and determines whether it is possible to perform an exchange of elements between them to make lst1 a list of only even numbers. There is no limit on the number of exchanged elements between lst1 and ...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_110_exchange.py
verbatim
unittest { alias candidate = exchange; assert(candidate([1L, 2L, 3L, 4L], [1L, 2L, 3L, 4L]) == "YES"); assert(candidate([1L, 2L, 3L, 4L], [1L, 5L, 3L, 4L]) == "NO"); assert(candidate([1L, 2L, 3L, 4L], [2L, 1L, 4L, 3L]) == "YES"); assert(candidate([5L, 7L, 3L], [2L, 6L, 4L]) == "YES"); assert(ca...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_111_histogram
d
import std.math; import std.typecons; /* Given a string representing a space separated lowercase letters, return a dictionary of the letter with the most repetition and containing the corresponding count. If several letters have the same occurrence, return all of them. Example: histogram('a b c') == {'a': 1, 'b': 1, 'c...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_111_histogram.py
verbatim
unittest { alias candidate = histogram; { auto result = candidate("a b b a"); assert(!result.isNull && result.get == ["a": 2L, "b": 2L]); } { auto result = candidate("a b c a b"); assert(!result.isNull && result.get == ["a": 2L, "b": 2L]); } { auto result = candidate("a b ...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_112_reverse_delete
d
import std.math; import std.typecons; /* Task We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c then check if the result string is palindrome. A string is called palindrome if it reads the same backward as forward. You should return a tuple containing the...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_112_reverse_delete.py
verbatim
unittest { alias candidate = reverse_delete; assert(candidate("abcde", "ae") == tuple("bcd", false)); assert(candidate("abcdef", "b") == tuple("acdef", false)); assert(candidate("abcdedcba", "ab") == tuple("cdedc", true)); assert(candidate("dwik", "w") == tuple("dik", false)); assert(candidate(...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_113_odd_count
d
import std.math; import std.typecons; /* Given a list of strings, where each string consists of only digits, return a list. Each element i of the output should be "the number of odd elements in the string i of the input." where all the i's should be replaced by the number of odd digits in the i'th string of the input. ...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_113_odd_count.py
verbatim
unittest { alias candidate = odd_count; assert(candidate(["1234567"]) == ["the number of odd elements 4n the str4ng 4 of the 4nput."]); assert(candidate(["3", "11111111"]) == ["the number of odd elements 1n the str1ng 1 of the 1nput.", "the number of odd elements 8n the str8ng 8 of the 8nput."]); asser...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_114_minSubArraySum
d
import std.math; import std.typecons; /* Given an array of integers nums, find the minimum sum of any non-empty sub-array of nums. Example minSubArraySum([2, 3, 4, 1, 2, 4]) == 1 minSubArraySum([-1, -2, -3]) == -6 */ long minSubArraySum(long[] nums)
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_114_minSubArraySum.py
verbatim
unittest { alias candidate = minSubArraySum; assert(candidate([2L, 3L, 4L, 1L, 2L, 4L]) == 1L); assert(candidate([-1L, -2L, -3L]) == -6L); assert(candidate([-1L, -2L, -3L, 2L, -10L]) == -14L); assert(candidate([-9999999999999999L]) == -9999999999999999L); assert(candidate([0L, 10L, 20L, 1000000...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_115_max_fill
d
import std.math; import std.typecons; /* You are given a rectangular grid of wells. Each row represents a single well, and each 1 in a row represents a single unit of water. Each well has a corresponding bucket that can be used to extract water from it, and all buckets have the same capacity. Your task is to use the b...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_115_max_fill.py
verbatim
unittest { alias candidate = max_fill; assert(candidate([[0L, 0L, 1L, 0L], [0L, 1L, 0L, 0L], [1L, 1L, 1L, 1L]], 1L) == 6L); assert(candidate([[0L, 0L, 1L, 1L], [0L, 0L, 0L, 0L], [1L, 1L, 1L, 1L], [0L, 1L, 1L, 1L]], 2L) == 5L); assert(candidate([[0L, 0L, 0L], [0L, 0L, 0L]], 5L) == 0L); assert(candid...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_116_sort_array
d
import std.math; import std.typecons; /* In this Kata, you have to sort an array of non-negative integers according to number of ones in their binary representation in ascending order. For similar number of ones, sort based on decimal value. It must be implemented like this: >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3,...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_116_sort_array.py
verbatim
unittest { alias candidate = sort_array; assert(candidate([1L, 5L, 2L, 3L, 4L]) == [1L, 2L, 4L, 3L, 5L]); assert(candidate([-2L, -3L, -4L, -5L, -6L]) == [-4L, -2L, -6L, -5L, -3L]); assert(candidate([1L, 0L, 2L, 3L, 4L]) == [0L, 1L, 2L, 4L, 3L]); assert(candidate([]) == []); assert(candidate([2L...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_117_select_words
d
import std.math; import std.typecons; /* Given a string s and a natural number n, you have been tasked to implement a function that returns a list of all words from string s that contain exactly n consonants, in order these words appear in the string s. If the string s is empty then the function should return an empt...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_117_select_words.py
verbatim
unittest { alias candidate = select_words; assert(candidate("Mary had a little lamb", 4L) == ["little"]); assert(candidate("Mary had a little lamb", 3L) == ["Mary", "lamb"]); assert(candidate("simple white space", 2L) == []); assert(candidate("Hello world", 4L) == ["world"]); assert(candidate("...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_118_get_closest_vowel
d
import std.math; import std.typecons; /* You are given a word. Your task is to find the closest vowel that stands between two consonants from the right side of the word (case sensitive). Vowels in the beginning and ending doesn't count. Return empty string if you didn't find any vowel met the above condition. You may...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_118_get_closest_vowel.py
verbatim
unittest { alias candidate = get_closest_vowel; assert(candidate("yogurt") == "u"); assert(candidate("full") == "u"); assert(candidate("easy") == ""); assert(candidate("eAsy") == ""); assert(candidate("ali") == ""); assert(candidate("bad") == "a"); assert(candidate("most") == "o"); ...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_119_match_parens
d
import std.math; import std.typecons; /* You are given a list of two strings, both strings consist of open parentheses '(' or close parentheses ')' only. Your job is to check if it is possible to concatenate the two strings in some order, that the resulting string will be good. A string S is considered to be good if an...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_119_match_parens.py
verbatim
unittest { alias candidate = match_parens; assert(candidate(["()(", ")"]) == "Yes"); assert(candidate([")", ")"]) == "No"); assert(candidate(["(()(())", "())())"]) == "No"); assert(candidate([")())", "(()()("]) == "Yes"); assert(candidate(["(())))", "(()())(("]) == "Yes"); assert(candidate(...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_11_string_xor
d
import std.math; import std.typecons; /* Input are two strings a and b consisting only of 1s and 0s. Perform binary XOR on these inputs and return result also as a string. >>> string_xor('010', '110') '100' */ string string_xor(string a, string b)
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_11_string_xor.py
verbatim
unittest { alias candidate = string_xor; assert(candidate("111000", "101010") == "010010"); assert(candidate("1", "1") == "0"); assert(candidate("0101", "0000") == "0101"); } void main(){}
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_120_maximum
d
import std.math; import std.typecons; /* Given an array arr of integers and a positive integer k, return a sorted list of length k with the maximum k numbers in arr. Example 1: Input: arr = [-3, -4, 5], k = 3 Output: [-4, -3, 5] Example 2: Input: arr = [4, -4, 4], k = 2 Output: [4, 4] Example 3: In...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_120_maximum.py
verbatim
unittest { alias candidate = maximum; assert(candidate([-3L, -4L, 5L], 3L) == [-4L, -3L, 5L]); assert(candidate([4L, -4L, 4L], 2L) == [4L, 4L]); assert(candidate([-3L, 2L, 1L, 2L, -1L, -2L, 1L], 1L) == [2L]); assert(candidate([123L, -123L, 20L, 0L, 1L, 2L, -3L], 3L) == [2L, 20L, 123L]); assert(...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_121_solution
d
import std.math; import std.typecons; /* Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions. Examples solution([5, 8, 7, 1]) ==> 12 solution([3, 3, 3, 3, 3]) ==> 9 solution([30, 13, 24, 321]) ==>0 */ long solution(long[] lst)
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_121_solution.py
verbatim
unittest { alias candidate = solution; assert(candidate([5L, 8L, 7L, 1L]) == 12L); assert(candidate([3L, 3L, 3L, 3L, 3L]) == 9L); assert(candidate([30L, 13L, 24L, 321L]) == 0L); assert(candidate([5L, 9L]) == 5L); assert(candidate([2L, 4L, 8L]) == 0L); assert(candidate([30L, 13L, 23L, 32L]) ...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_122_add_elements
d
import std.math; import std.typecons; /* Given a non-empty array of integers arr and an integer k, return the sum of the elements with at most two digits from the first k elements of arr. Example: Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4 Output: 24 # sum of 21 + 3 Constraints: 1. 1 <= len(arr) <= 100 ...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_122_add_elements.py
verbatim
unittest { alias candidate = add_elements; assert(candidate([1L, -2L, -3L, 41L, 57L, 76L, 87L, 88L, 99L], 3L) == -4L); assert(candidate([111L, 121L, 3L, 4000L, 5L, 6L], 2L) == 0L); assert(candidate([11L, 21L, 3L, 90L, 5L, 6L, 7L, 8L, 9L], 4L) == 125L); assert(candidate([111L, 21L, 3L, 4000L, 5L, 6L...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_123_get_odd_collatz
d
import std.math; import std.typecons; /* Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence. The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined as follows: start with any positive integer n. Then each term is obtained from the previous term...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_123_get_odd_collatz.py
verbatim
unittest { alias candidate = get_odd_collatz; assert(candidate(14L) == [1L, 5L, 7L, 11L, 13L, 17L]); assert(candidate(5L) == [1L, 5L]); assert(candidate(12L) == [1L, 3L, 5L]); assert(candidate(1L) == [1L]); } void main(){}
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_124_valid_date
d
import std.math; import std.typecons; /* You have to write a function which validates a given date string and returns True if the date is valid otherwise False. The date is valid if all of the following rules are satisfied: 1. The date string is not empty. 2. The number of days is not less than 1 or higher than 31 days...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_124_valid_date.py
verbatim
unittest { alias candidate = valid_date; assert(candidate("03-11-2000") == true); assert(candidate("15-01-2012") == false); assert(candidate("04-0-2040") == false); assert(candidate("06-04-2020") == true); assert(candidate("01-01-2007") == true); assert(candidate("03-32-2011") == false); ...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_126_is_sorted
d
import std.math; import std.typecons; /* Given a list of numbers, return whether or not they are sorted in ascending order. If list has more than 1 duplicate of the same number, return False. Assume no negative numbers and only integers. Examples is_sorted([5]) ➞ True is_sorted([1, 2, 3, 4, 5]) ➞ True is_sorted([1, 3, ...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_126_is_sorted.py
verbatim
unittest { alias candidate = is_sorted; assert(candidate([5L]) == true); assert(candidate([1L, 2L, 3L, 4L, 5L]) == true); assert(candidate([1L, 3L, 2L, 4L, 5L]) == false); assert(candidate([1L, 2L, 3L, 4L, 5L, 6L]) == true); assert(candidate([1L, 2L, 3L, 4L, 5L, 6L, 7L]) == true); assert(ca...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_127_intersection
d
import std.math; import std.typecons; /* You are given two intervals, where each interval is a pair of integers. For example, interval = (start, end) = (1, 2). The given intervals are closed which means that the interval (start, end) includes both start and end. For each given interval, it is assumed that its start is ...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_127_intersection.py
verbatim
unittest { alias candidate = intersection; assert(candidate(tuple(1L, 2L), tuple(2L, 3L)) == "NO"); assert(candidate(tuple(-1L, 1L), tuple(0L, 4L)) == "NO"); assert(candidate(tuple(-3L, -1L), tuple(-5L, 5L)) == "YES"); assert(candidate(tuple(-2L, 2L), tuple(-4L, 0L)) == "YES"); assert(candidate...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]
HumanEval_128_prod_signs
d
import std.math; import std.typecons; /* You are given an array arr of integers and you need to return sum of magnitudes of integers multiplied by product of all signs of each number in the array, represented by 1, -1 or 0. Note: return None for empty arr. Example: >>> prod_signs([1, 2, 2, -4]) == -9 >>> prod_signs([0,...
keep
/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals/HumanEval_128_prod_signs.py
verbatim
unittest { alias candidate = prod_signs; { auto result = candidate([1L, 2L, 2L, -4L]); assert(!result.isNull && result.get == -9L); } { auto result = candidate([0L, 1L]); assert(!result.isNull && result.get == 0L); } { auto result = candidate([1L, 1L, 1L, 2L, 3L, -1L, 1L])...
[ "\n\n", "\nvoid", "\nbool", "\nint" ]